-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I have a file that yields a wavenumbers subscript out of bounds error:
opusreader::opus_read(path)
# Error in wavenumbers[[i]] : subscript out of bounds
# [1] "Error in wavenumbers[[i]] : subscript out of bounds\n"
# attr(,"class")
# [1] "try-error"
# attr(,"condition")
# <simpleError in wavenumbers[[i]]: subscript out of bounds>
I debugged the code and found that it failed here:
https://github.com/pierreroudier/opusreader/blob/main/R/opus_read_raw.R#L851
The code is:
spc_m <- setNames(
lapply(
seq_along(spc_m),
function(i) {
colnames(spc_m[[i]]) <- round(wavenumbers[[i]], 1)
rownames(spc_m[[i]]) <- unique_id
spc_m[[i]]
}
),
names(spc_m)
)
seq_along(spc_m) yields a sequence from 1 to 7. In this particular case, wavenumbers[[6]] has data, but wavenumbers[[7]] does not exist.
I'm talking with my CSIRO collaborators re: whether I can make the file in question available to you for testing. It's just one file out of almost 1000 and this is the only one that fails. So, whether it's a problem with the code or the file is another question, but it appears to have the right length.
Metadata
Metadata
Assignees
Labels
No labels