Re: [R] computing a subset using a loop

2012-07-16 Thread burton030
Hi, thanks I think now I understand how it works... I m using now this code for the first specie in all my transect IDs. df.s - split(Baumdaten, list(Baumdaten$transectID, Baumdaten$Baumart), drop = TRUE) head(names(df.s), 10) A_SEF_Abies alba A_LEF_Abies alba B_SEF_Abies alba B_LEF_Abies alba

Re: [R] computing a subset using a loop

2012-07-16 Thread jim holtman
If you just wanted to do a boxplot of one of the subset, you would do something like: boxplot(df.s[[A_SEF_Abies alba]]$age) If you wanted to do it for all the subset, then something like: lapply(df.s, function(.sub) boxplot(.sub$age)) On Mon, Jul 16, 2012 at 11:14 AM, burton030

Re: [R] computing a subset using a loop

2012-07-15 Thread jim holtman
I looks like you want to use the 'split' function which would create a list of dataframes with the various conditions: result - split(Baumdaten, list(Baumdaten$transectID, Baumdaten$Baumart), drop = TRUE) On Sun, Jul 15, 2012 at 11:31 AM, burton030 burto...@hotmail.de wrote: Dear all, I have

Re: [R] computing a subset using a loop

2012-07-15 Thread burton030
http://r.789695.n4.nabble.com/file/n4636585/Baumdaten_aufbereitet.csv Baumdaten_aufbereitet.csv Here you have an overview about my data frame... -- View this message in context: http://r.789695.n4.nabble.com/computing-a-subset-using-a-loop-tp4636564p4636585.html Sent from the R help mailing

Re: [R] computing a subset using a loop

2012-07-15 Thread burton030
Hi, thanks for your reply but this code just gives me a list but no subsets but I need subsets because I want to do some calculations with these subsets and want do make some plots etc. Is there a solution for my problem? I ve posted an example for the first subset...

Re: [R] computing a subset using a loop

2012-07-15 Thread jim holtman
Here is an example of using your data to split it into the subsets and then computing a summary of each subset. You have to remember that what is returned from 'split' is a 'list' of 'data.frames' that as the subsets that you want and then use use 'lapply' to process each of the subsets in the