Re: [R] list & calculaton in many df subsets

About this list Date view Thread view Subject view Author view Attachment view

From: Spencer Graves (spencer.graves@pdf.com)
Date: Wed 19 May 2004 - 01:18:33 EST


Message-id: <40AA2949.8090202@pdf.com>

Have you considered "lapply(by(...), ...)"? The help for "by" includes
an example using sapply. See also Venables and Ripley, Modern Applied
Statistics with S.

hope this helps. spencer graves

Christian Schulz wrote:

>Hi,
>
>have anybody a hint /starting point how i can
>enlarge my code that's posiible for me make any calculaton's
>with variables in the 64 subset's.
>
>Example:
>I want calculate difference of two variables inside every
>of the 64 subset data.frames and getting this value in tList!
>
>Many thanks,
>Christian
>
>
>tasign <- paste("tList[[n]] <- try(dtree[dtree$class02 ==
>paste(data$class02[n]) & dtree$class04 == paste(data$class04[n]) &
>dtree$PREDICT==paste(data$PREDICT[n]),])")
>tasign <- parse(text=tasign)[[1]]
>
>for(n in 1:nrow(data)) {
> TAsign <- do.call("substitute",list(tasign,list(n=n,X=as.name(n))))
> eval(TAsign)
>}
>
>______________________________________________
>R-help@stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:11 EST