RfastOfficial / Rfast

A collection of Rfast functions for data analysis. Note 1: The vast majority of the functions accept matrices only, not data.frames. Note 2: Do not have matrices or vectors with have missing data (i.e NAs). We do no check about them and C++ internally transforms them into zeros (0), so you may get wrong results. Note 3: In general, make sure you give the correct input, in order to get the correct output. We do no checks and this is one of the many reasons we are fast.
143 stars 19 forks source link

wrong calculation of "colMins" #13

Closed XiaoruiZhu closed 4 years ago

XiaoruiZhu commented 4 years ago

test1 <- matrix(c(1,0,1,0,1,0.000009), 2,3, byrow = F)

#         [,1] [,2]  [,3]
# [1,]    1    1 1e+00
# [2,]    0    0 9e-06

colMins(test1) # Gives wrong values

# 2 2 2

statlink commented 4 years ago

Why is this a mistake? For each column you want the position of the minimum value. If you want the value, then type colMins(set1, value=TRUE)