in this case you just need:
mean(data$variable > value & !is.na(data$variable))
I hope it helps.
Best,
Dimitris
Stefan Björk wrote:
I want to get the relative frequency of cases in a data frame that
matches a specified criteria, omiting NA values. This seem so simple,
but I can't come up wi
I want to get the relative frequency of cases in a data frame that
matches a specified criteria, omiting NA values. This seem so simple,
but I can't come up with an effective way.
nrow(data[data$variable>value & !is.na(data$variable),])/nrow(data)
works but is very ineffective and CPU consuming w
2 matches
Mail list logo