Re: [R] Binding objects with a similar name

2009-10-12 Thread jimdare
Thanks Jim, Further from this; the data I have doen't appear to be that complete for some species e.g result$MOO 1992 2000 2002 3060 1300 1300 How can I change this list into a time series so that I can create a meaningful plot e.g. 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2

Re: [R] Binding objects with a similar name

2009-10-12 Thread jim holtman
Instead of creating a lot of variables, work with a list. Since you did not supply any test data, I will make a guess at the code would be like: result <- lapply(split(newdataset, newdataset$target_species), function(.spec){ tappy(.spec$total_hook_num, .spec$year, sum) }) You can summarize f

[R] Binding objects with a similar name

2009-10-12 Thread jimdare
Dear R users, The code below splits a dataset by "target_species" and then further splits each target species group by year. Finally the sum of a variable called "total_hook_num" is calculated and then assigned a name based on (paste(a$target_species[1],a$year[1],sep=""). newsplit<-split(newd