Open alexiswl opened 2 years ago
Hm, this seems to be not passing na.rm = TRUE
to base::sum
as its na.rm
arg, but instead including that in the addition :thinking:
I suppose that's due to https://github.com/Rapporter/rapportools/compare/v1.0...v1.1#diff-edee52205cb468aab8add6b6c383302050e965bacfedede0653218751c4387afL151-R151, but I will not have the time to do a throughout testing in the immediate future -- would appreciate any related help there.
I suppose that's due to https://github.com/Rapporter/rapportools/compare/v1.0...v1.1diff-edee52205cb468aab8add6b6c383302050e965bacfedede0653218751c4387afL151-R151, but I will not have the time to do a throughout testing in the immediate future -- would appreciate any related help there.
That link doesn't work for me but I assume you're referring to: https://github.com/Rapporter/rapportools/blob/v1.1/R/univar.R#L150-L151
Could explicity parse these arguments in for each wrapper of univar? so max, mean, min etc? and along with the stats functions that are masked, IQR, median, sd etc.
i.e
sum <- function(...)
univar(..., fn = base::sum)
Becomes
sum <- function(..., na.rm=TRUE){
rapportools:::univar(..., na.rm=na.rm, fn = base::sum)
}
This seems to work
> library(rapportools)
> my_list <- c("a", "b", "c")
> sum("a" %in% my_list, na.rm=TRUE)
[1] 2
> sum <- function(..., na.rm=TRUE){
rapportools:::univar(..., na.rm=na.rm, fn = base::sum)
}
> sum("a" %in% my_list)
[1] 1
I understand you might be pressed for time but it's a pretty serious bug given that these functions mask the base functions but behave quite differently without erroring and would kindly ask that this is prioritized. It took me quite a while to narrow down the issue.
I re-installed the package and the issue is still present. The bug made me waste at least two hours, I was desperately trying to find where I was introducing 1's.
Hello,
This appears to be an issue introduced into rapportools v1.1