r-quantities / quantities

Quantity Calculus for R Vectors
https://r-quantities.github.io/quantities
Other
26 stars 3 forks source link

[feature request]: support for censored data and analysis methods #6

Closed vorpalvorpal closed 4 years ago

vorpalvorpal commented 4 years ago

Thank you for this fantastic package. It's exactly what I dreamed of creating, but did not have the skill to create myself. I really feel like it should be a part of base R.

I'm not sure if this would fall into the scope of what you want for the package, or not, but a lot of measurement data has lower (and less frequently upper) detection/quantification/reporting limits. I work a lot with water sampling data, and this almost always has a lower reporting limit. Values less than this limit are reported as "below reporting limit", rather than as numerics. I realise this might be outside the scope of the package because the correct way to treat censored data is not as clear cut as units or errors.

On a related note, many measurements have a standardised method associated with them. It might be nice to treat this a bit like units, though less strictly. Possibly just giving a warning if an operation acts on two objects with different methods. Again, this may be outside of what you see as the legitimate scope of the package.

Enchufa2 commented 4 years ago

I see this a little bit out of the scope, yes. I think this could be just another subclass playing along with {quantities}, something like c("censored", "quantities", "units", "errors"). Every method defined for "censored" would be executed in the first place, so that it can check the method, impose limits... and then forward the rest of the functionality to {quantities}.

vorpalvorpal commented 4 years ago

No worries, just thought I'd check in. I'll close this issue, and continue with my own subclass.