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

Wavelength subsetting fails if formula is passed as a variable #56

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

Wavelength subsetting fails if formula is passed as a variable #56

GegznaV opened this issue Aug 12, 2021 · 0 comments

Comments

@GegznaV
Copy link
Member

GegznaV commented Aug 12, 2021

Original issue was:


When I pass wavelength range as a variable, functions [ and [[ fail. If I pass the formula directly, no issue is present.
Is it a bug or did I do something wrong?

suppressPackageStartupMessages(library(hyperSpec))

# Works
flu[, 1:2, min ~ 320]
#> hyperSpec object
#>    6 spectra
#>    2 data columns
#>    0 data points / spectrum
#> wavelength: lambda/nm [numeric]
#> data:  (6 rows x 2 columns)
#>    1. spc: I[fl]/"a.u." [matrix, array0]
#>    2. filename: filename [character] rawdata/flu1.txt rawdata/flu2.txt ... rawdata/flu6.txt

# Fails
wl_range <- min ~ 320
flu[, 1:2, wl_range]
#> Error in Re(from): non-numeric argument to function

Created on 2020-07-14 by the reprex package (v0.3.0)


For the subsequent valuable comments and discussion, see:

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