Re: [R] more classes to one class in one dataset

From: Jan Sabee <jan.sabee_at_gmail.com>
Date: Wed 23 Mar 2005 - 21:51:49 EST

Thanks. It's work.

Jan Sabee

On Wed, 23 Mar 2005 11:30:22 +0100, Dimitris Rizopoulos <dimitris.rizopoulos@med.kuleuven.ac.be> wrote:
> try this:
>
> split(dat, dat$class)
>
> where 'dat' is your data.frame
>
> I hope it helps.
>
> Best,
> Dimitris
>
> ----
> Dimitris Rizopoulos
> Ph.D. Student
> Biostatistical Centre
> School of Public Health
> Catholic University of Leuven
>
> Address: Kapucijnenvoer 35, Leuven, Belgium
> Tel: +32/16/336899
> Fax: +32/16/337015
> Web: http://www.med.kuleuven.ac.be/biostat/
> http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
>
>
> ----- Original Message -----
> From: "Jan Sabee" <jan.sabee@gmail.com>
> To: <R-help@stat.math.ethz.ch>
> Sent: Wednesday, March 23, 2005 11:17 AM
> Subject: [R] more classes to one class in one dataset
>
> >I have a big database which more classes in class variable. I want to
> > make each class to one dataset, for example:
> > x1 x2 x3 x4 class
> > a b a c c M1
> > c b b c c M4
> > c c a c c M2
> > c a c a a M2
> > c c a a a M1
> > c a b c a M3
> > c c a b c M3
> > c a c a b M2
> > c c a b a M1
> >
> > How can I make, like:
> >
> > x1 x2 x3 x4 class
> > a b a c c M1
> > c c a a a M1
> > c c a b a M1
> >
> > x1 x2 x3 x4 class
> > c c a c c M2
> > c a c a a M2
> > c a c a b M2
> >
> > x1 x2 x3 x4 class
> > c a b c a M3
> > c c a b c M3
> >
> > x1 x2 x3 x4 class
> > c b b c c M4
> >
> > Thanks for your help.
> > Jan Sabee
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> > http://www.R-project.org/posting-guide.html
> >
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Mar 23 21:57:36 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:55 EST