On Jan 4, 2012, at 7:41 AM, Dan Abner <dan.abne...@gmail.com> wrote:
> Hello everyone, > > I have the following call to sapply() and error message. Is the most > efficient way to deal with this to make sum(!is.na(x)) a function in a > separate line prior to this call? Yes or inline using an anonymous/lambda function: sapply(XX, function(x) sum(!is.na(x))) > If not, please advise. > > N.Valid=sapply(x,sum(!is.na(x))) > Error in match.fun(FUN) : > 'sum(!is.na(x))' is not a function, character or symbol > > > Thanks! > > Dan > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. ______________________________________________ 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.