Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In spc_bin(), na.rm = 2 throws error #54

Open
GegznaV opened this issue Aug 12, 2021 · 0 comments
Open

In spc_bin(), na.rm = 2 throws error #54

GegznaV opened this issue Aug 12, 2021 · 0 comments

Comments

@GegznaV
Copy link
Member

GegznaV commented Aug 12, 2021

Is an error expected in this situation (spc.bin(na.rm = 2))?

suppressPackageStartupMessages(library(hyperSpec))

# Example 1: Error
data(flu, package = "hyperSpec")
flu[[3, , 3, wl.index = TRUE]] <- NA_real_
spc_bin(flu, 1, na.rm = 2)
#> Error in tapply(spc@wavelength, bin, mean, na.rm = na.rm > 0): arguments must have same length
More examples
suppressPackageStartupMessages(library(hyperSpec))

# Example 2: Error
data(flu, package = "hyperSpec")
flu[[, , 3, wl.index = TRUE]] <- NA_real_
spc_bin(flu, 1, na.rm = 2)
#> Error in tapply(spc@wavelength, bin, mean, na.rm = na.rm > 0): arguments must have same length

# Example 3: Error
data(flu, package = "hyperSpec")
flu[[3, ]] <- NA_real_
spc_bin(flu, 1, na.rm = 2)
#> Error in tapply(spc@wavelength, bin, mean, na.rm = na.rm > 0): arguments must have same length

Originally was opened as:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant