Skip to content
Prev 280834 / 398503 Next

Applying a function

Joanie Van De Walle wrote
Hello,

Here is a one line function

recovery.rate <- function(x) unlist(lapply(split(tab1, tab1[,2]),
function(x) mean(x[[4]]=="y")))

It works with that table. I hope it helps

Merry Christmas

Rui Barradas


--
View this message in context: http://r.789695.n4.nabble.com/Applying-a-function-tp4229277p4230100.html
Sent from the R help mailing list archive at Nabble.com.