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 when the data frame is
large (more than 13000 rows and 400 columns).

/S

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to