Hi Matevž,

Perhaps split() is what you are looking for:

# some data

x <- rep(rpois(5, 10), 4)

y <- rnorm(20)

d <- data.frame(x, y)

d

split(d, x)

See ?split and ?strsplit for more information.

HTH,
Jorge


On Sat, 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.
>
>
>
> Thanks for the help, m
>
>
>
>
>
>
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
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