Answers for "r count number of TRUE in dataframe per row"

1

how to count the true values in r

a = c(NA,T,F,F)
sum(a, na.rm=TRUE) # best way to count TRUE values #which gives 1.
Posted by: Guest on October-09-2020
0

r count number of TRUE in dataframe per row

sum(data[,x]>0)
Posted by: Guest on March-27-2022

Code answers related to "r count number of TRUE in dataframe per row"

Browse Popular Code Answers by Language