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

Behaviour of quantile() #227

Open
GegznaV opened this issue Jul 26, 2020 · 0 comments
Open

Behaviour of quantile() #227

GegznaV opened this issue Jul 26, 2020 · 0 comments
Labels
Type: enhancement 🎈 asking for a new feature. Type: proposal 💡 Proposed ideas for all to consider.

Comments

@GegznaV
Copy link
Collaborator

GegznaV commented Jul 26, 2020

Wouldn't it be more reasonable to create a new column in @data with quantiles instead of adding this info to row names, which is not so intuitive? Especially as the values in @data are set to NA.
Data in a column would be easier to access for plotting, etc.

suppressPackageStartupMessages(library(hyperSpec))

flu
#> hyperSpec object
#>    6 spectra
#>    3 data columns
#>    181 data points / spectrum
#> wavelength: lambda/nm [numeric] 405.0 405.5 ... 495 
#> data:  (6 rows x 3 columns)
#>    1. spc: I[fl]/"a.u." [matrix, array181] 27.15000 66.80133 ... 294.6495 
#>    2. filename: filename [character] rawdata/flu1.txt rawdata/flu2.txt ... rawdata/flu6.txt 
#>    3. c: c / (mg / l) [numeric] 0.05 0.10 ... 0.3

flu_pretty_quantiles <- quantile(flu, names = "pretty")

rownames(flu_pretty_quantiles)
#> [1] "  0 %" " 50 %" "100 %"

flu_pretty_quantiles$..
#>       filename  c
#>   0 %     <NA> NA
#>  50 %     <NA> NA
#> 100 %     <NA> NA

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

@GegznaV GegznaV added Type: enhancement 🎈 asking for a new feature. Type: proposal 💡 Proposed ideas for all to consider. labels Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement 🎈 asking for a new feature. Type: proposal 💡 Proposed ideas for all to consider.
Projects
None yet
Development

No branches or pull requests

1 participant