Closed thewoodsofcoding closed 4 years ago
It is not a bug. It's just that I have never thought that someone would really have this case in his data. What do you want as result?
Thanks for the fast response! Best would be to return an NA
for cases of only one value or non value (only NA
) columns.
Done.
Hi, I use Rfast for robust calculations on huge data sets, say 1000+ rows for each column. I want to calculate col medians and col mads. It happens that
Rfast::colMedians()
andRfast::colMads()
have no issue withNA
but only calculate median or mad ifNA
is <50% of the columns content, however I want it also to be calculated even if there are only, lets say 2 of 1000 values!= NA
, so I usena.rm = T
. I also have columns that have onlyNA
and thous will be calculated asNA
forRfast::colMedians(mat, na.rm = T)
so it works fine. But forRfast::colMads(mat, na.rm = T)
R session crashes as soon there areNA
only columns inmat
. Sure I can removeNA
only columns prior to calculation, but I think this is a bug ofRfast::colMads(mat, na.rm = T)
function. Attached find an example for reproduction: