Skip to content
Back to formatted view

Raw Message

Message-ID: <1324682734255-4230106.post@n4.nabble.com>
Date: 2011-12-23T23:25:34Z
From: Rui Barradas
Subject: Applying a function
In-Reply-To: <52421CEE792DBA48A56D35AC1BC7ADBB01905AECDF53@EXCH-MBX-G.ulaval.ca>

Sorry, in the function body, NO 'tab1', use 'x' only:

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

The error is because 'tab1' existed in the environment and the function
would find it.

This time, tested after removing 'tab1'.

Rui Barradas



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