Re: [R] Subsets of a function

2014-05-20 Thread ONKELINX, Thierry
spronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens jim holtman Verzonden: dinsdag 20 mei 2014 2:44 Aan: Marlin Keith Cox CC: r-help@r-project.org Onderwerp: Re: [R] Subsets of a function It would have been nice if you at least supplied a subset

Re: [R] Subsets of a function

2014-05-19 Thread jim holtman
It would have been nice if you at least supplied a subset of the data, but here is a try at it: myList <- split(size, list(size$Year, size$Season)) result <- lapply(myList, function(.sub){ smooth.spline(.sub$Size, spar = 0.25) }) Jim Holtman Data Munger Guru What is the problem that you a

Re: [R] Subsets of a function

2014-05-19 Thread Bert Gunter
Have you read "An Introduction to R" and sections on indexing (?"[") where this is discussed. Have you read about apply type functions there like ?tapply. If not, don't you think you should. If so, read again. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is

[R] Subsets of a function

2014-05-19 Thread Marlin Keith Cox
Hi all, this is a reoccurring theme in my programming and I need some help with it. When I use a built in function and need to use it on a subset of my data frame, I always end up using the subset function first, but this seems very clunky. For example, if I have years 2003:2013 with season "a" a