Re: [R] split data frame by factor

From: ivan <i.petzev_at_gmail.com>
Date: Mon, 25 Apr 2011 23:29:40 +0200

sorry, the problem has been solved.

On Mon, Apr 25, 2011 at 11:28 PM, ivan <i.petzev_at_gmail.com> wrote:
> Dear Community,
>
> I have a dataframe like this one:
>
> A       B
> 5       1
> 6       1
> 7       1
> 8       1
> 9       2
> 10      2
> 11      2
> 12      2
>
> I have a problem splitting up the above data frame in respect to the
> factor represented by B, whereas the resulting vector should contain
> the numeric values only. I tried split() but it produces this:
> A       B
> [1]
> 5       1
> 6       1
> 7       1
> 8       1
> [2]
> 9       2
> 10      2
> 11      2
> 12      2
>
> I want to achieve this,though:
>
> A
> [1]
> 5
> 6
> 7
> 8
> [2]
> 9
> 10
> 11
> 12
>
> How is this done? Thank you very much in advance.
>
> Best Regards.
>



R-help_at_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. Received on Mon 25 Apr 2011 - 21:35:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 25 Apr 2011 - 22:10:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive