Hello, Catalin,

assume your data frame is as simple as

A <- data.frame( year = <years>, month01 = <values01>, ....,
+                  month12 = <values12>)

then, e.g.,

reshape( A, varying = c( "month01", ...., "month12"),
+          v.names = "Values", timevar = "Month", direction = "long")

should do what you want. For details see ?reshape

Hth  -- Gerrit


On Mon, 26 Aug 2013, catalin roibu 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@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.

______________________________________________
R-help@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.

Reply via email to