-
Notifications
You must be signed in to change notification settings - Fork 11
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 #212
Comments
I know this behavior does not seem logical and was surprising for me as well, but this is rooted deeply into the strangeness of the R language. wl_range <- expression(min ~ 320)
flu[,1:2, wl_range]
#> 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." [matrix0]
#> 2. filename: filename [character] rawdata/flu1.txt rawdata/flu2.txt ... rawdata/flu6.txt
typeof(expression(min ~ 320))
#> [1] "expression"
typeof(min ~ 320)
#> [1] "language" I'm not sure if anything should or can be done about this. I'd prefer to ask @cbeleites , she knows better. |
The high priority label is only because this has aspects that I think we should consider in the next video call. After that, it may turn out to be low priority or high priority to be done before the 1.0 milestone - depending on our decision. |
Without looking into details, I think what happens is that a Possible alternatives:
Any change to the user interface here should be decided before Milestone 1.0 |
This discussion was moved and reopen as: |
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 I do something wrong?
Created on 2020-07-14 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: