[R] Reshape? I need it?

Michael Bedward michael.bedward at gmail.com
Thu Aug 5 15:28:55 CEST 2010


Hello,

For that simple case you could just do...

newdf <- data.frame(A=df[df$TIPO == "A",2], B=df[df$TIPO == "B",2])

where df is the name of your existing data.frame

Michael


On 5 August 2010 20:57, spigo <nicola.spigolon at gmail.com> wrote:
>
> Dear all,
> I'm new here, I'm starting to learn R (oh my God!!). So, now I'm in panic
> because I have this situation:
>
>  TIPO   Avariato
> A       0.05
> B       0.09
> A       9
> B       8
> A       9
> B       3
>
> and this is what I would like to do:
>
> Avariato        A       B
> Avariato        0.05    0.09
> Avariato        9       8
> Avariato        9       3
>
> I don't know how to do it. I need to use reshape? how?
> thanks for your reply.
> Spigo
> --
> View this message in context: http://r.789695.n4.nabble.com/Reshape-I-need-it-tp2314700p2314700.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list