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 #241

Closed
GegznaV opened this issue Aug 3, 2020 · 1 comment
Closed

In spc.bin(), na.rm = 2 throws error #241

GegznaV opened this issue Aug 3, 2020 · 1 comment
Assignees
Labels
Type: bug 💣 something is not working as it should

Comments

@GegznaV
Copy link
Collaborator

GegznaV commented Aug 3, 2020

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

Created on 2020-08-03 by the reprex package (v0.3.0)

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
@GegznaV GegznaV added the Type: possibly bug ❓ Seems like a bug but needs conformation if it really is label Aug 3, 2020
@cbeleites cbeleites self-assigned this Aug 24, 2020
@cbeleites cbeleites added Type: bug 💣 something is not working as it should and removed Type: possibly bug ❓ Seems like a bug but needs conformation if it really is labels Aug 28, 2020
@GegznaV
Copy link
Collaborator Author

GegznaV commented Aug 12, 2021

@GegznaV GegznaV closed this as completed Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug 💣 something is not working as it should
Projects
None yet
Development

No branches or pull requests

2 participants