On Oct 30, 2010, at 2:07 PM, Matevž Pavlič wrote:

Hi,

I know this is probalby a very trivial thing to do for most of the R users, but since I just strated using it I have some problems....

I have a data.frame with a field called "razred". This field has values from 1 up to 15.

Is it possible to create a for loop that would create a new data frame for each of the "razred" values.

The R-way would be to use the split function and leave the result in a list to which the same operation could be also repeatedly performed using lapply.

?split

And take a look at the fourth example applying split to the builtin airquality dataframe.

The plyr package also provides functions on dataframes.

--

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to