Re: [R] Fwd: filter out many data.frames

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

From: Christian Schulz (ozric@web.de)
Date: Mon 17 May 2004 - 01:17:31 EST


Message-id: <200405161717.31378.ozric@web.de>


> So, why are you doing these complicated things?

Hmm, want upgrade my sklls, because
i need more and more function's to reduce
complexity in my analysis.
And try , do.call and match.call seems very usefuel and
i want at long last understand the flexbilty of this functions.

>
> Just using
> names(theList) <- apply(data, 1, paste, collapse="")
> (you want to replace data by the corrected name) after your loop in your
> first version would be sufficient, if you are going to name the list
> elements....

Yes many thanks, now it works and nrow or others things
could be easy changed or add.

Chrstian

data <- expand.grid(class02 = c("A","B","C","D"), class04 =
c("A","B","C","D"),PREDICT = c("A","B","C","D"))
tList <- vector("list", numeric(nrow(data)))
#names(tList) <- apply(data, 1, paste, collapse="")
tasign <- paste("tList[[n]] <- try(nrow(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)
}

names(tList) <- apply(data, 1, paste, collapse="")
results <- as.data.frame(unlist(dfl))
names(results) <- c("n")
results

______________________________________________
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