> abc
  id x y
1  A 3 4
2  A 1 3
3  B 2 6
4  B 4 8
5  C 5 4
6  C 6 7
> split(abc, abc$id)
$A
  id x y
1  A 3 4
2  A 1 3

$B
  id x y
3  B 2 6
4  B 4 8

$C
  id x y
5  C 5 4
6  C 6 7


On 1/19/07, Aimin Yan <[EMAIL PROTECTED]> wrote:
>
> I have a data(ABC) like this:
>
>      x   y
> A   3   4
> A   1   3
> B   2   6
> B   4   8
> C   5   4
> C   6   7
>
> I want to split this data into
>
> A:
>   x   y
> A   3   4
> A   1   3
>
> B
> B   2   6
> B   4   8
>
> C
> C   5   4
> C   6   7
>
> anyone knows how to do that?
>
> thanks,
>
> Aimin Yan
>
> ______________________________________________
> [email protected] 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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