dwinsemius at comcast.net
Wed May 12 19:41:25 CEST 2010
On May 12, 2010, at 1:28 PM, Daniel Malter wrote:
> There is too little information to answer your question definitively.
> However, an obvious reason is that you want to apply the function over
> columns of a data.frame, which is done with apply(), but you try to
> the function over elements of a list using lapply(). A list is not a
> data.frame and vice versa,
Not correct. Using your example below:
> which would be a good reason for your function to
Maybe, maybe not. lapply() works quite well with dataframes:
> lapply(data, sum)
> The below example works:
> Also, for debugging, you want to disassemble the whole and check
> whether the
> individual parts work. Does the "function()" work when applied on
> just one
> column, for example? If not, then you also have a problem with the
> definition of the function. If so, you would have to check, whether
> quantile or IQR function fails in one of the instances.
> View this message in context: http://r.789695.n4.nabble.com/function-tp2196408p2196445.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD
West Hartford, CT
More information about the R-help