[R] transform variables

Erich Neuwirth erich.neuwirth at univie.ac.at
Mon Aug 26 13:55:36 CEST 2013


Have a look at the packages reshape and reshape2
They were written with this type of problems in mind.

On Aug 26, 2013, at 1:04 PM, catalin roibu <catalinroibu at gmail.com> wrote:

> Dear all!
> 
> I have a data frame composed by 13 columns (year, and 12 months). I want to
> transform this data base in another like this
> year month values
> 1901 1
> 1901 2
> 1901 3
> .....
> 1901 12
> 1902  1
> 1902  2
> ....
> 1902  12
> 
> Is there a possibility to succeed that in R?
> 
> Thank you!
> 
> best regards!
> CR
> 
> -- 
> ---
> Catalin-Constantin ROIBU
> Lecturer PhD, Forestry engineer
> Forestry Faculty of Suceava
> Str. Universitatii no. 13, Suceava, 720229, Romania
> office phone     +4 0230 52 29 78, ext. 531
> mobile phone   +4 0745 53 18 01
>                       +4 0766 71 76 58
> FAX:                +4 0230 52 16 64
> silvic.usv.ro
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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