verbal-autopsy-software / openVA

R package for openVA: a suite of tools for multiple VA methods
4 stars 6 forks source link

Enhancement: Extra line #22

Closed mboyas-mitre closed 5 years ago

mboyas-mitre commented 5 years ago

https://github.com/verbal-autopsy-software/openVA/blob/f16a333a8355582de814e4fef85eda28bc1035ff/openVA/R/stackplot.r#L77

This line to read in a dataset should be unnecessary. By our understanding, it should be sufficient to just run data("SampleCategory", envir = environment()) (the line prior to this), which would improve readability and stability of the code.

richardli commented 5 years ago

I think this is a CRAN feature that forces packages to load data this way. Removing the second line leads to a CRAN note:

no visible binding for global variable ‘SampleCategory’

But feel free to suggest alternative options!

mboyas-mitre commented 5 years ago

Interesting! We did some research into this when we refactored the stackplotVA code and did not come up with a good alternative. We'll keep thinking about this but going to close for now; will let you know if we come up with something else!