[R] making dataframes

2011-03-16 Thread pelt
Dear all, I have a dataframe which looks like this (dummy): date-c(jan, feb, mar, apr, may, june, july, aug,sep,oct,nov,dec) col1-c(8.2,5.4,4.3,4.1,3.1,2.5,1.1,4.5,3.2,1.9,7.8,6.5) col2-c(3.1,2.3,4.7,6.9,7.5,1.1,3.6,8.5,7.5,2.5,4.1,2.3) dum-data.frame(cbind(date,col1,col2)) dum date col1

Re: [R] making dataframes

2011-03-16 Thread Scott Chamberlain
require(reshape2) melt(dum, id = 1) On Wednesday, March 16, 2011 at 9:28 AM, pelt wrote: Dear all, I have a dataframe which looks like this (dummy): date-c(jan, feb, mar, apr, may, june, july, aug,sep,oct,nov,dec) col1-c(8.2,5.4,4.3,4.1,3.1,2.5,1.1,4.5,3.2,1.9,7.8,6.5)

Re: [R] making dataframes

2011-03-16 Thread Henrique Dallazuanna
Try this: reshape(dum, direction = 'long', idvar = 'date', varying = list(c('col1', 'col2'))) On Wed, Mar 16, 2011 at 11:28 AM, pelt p...@knmi.nl wrote: Dear all, I have a dataframe which looks like this (dummy): date-c(jan, feb, mar, apr, may, june, july, aug,sep,oct,nov,dec)

Re: [R] making dataframes

2011-03-16 Thread Bill.Venables
1.80 2.35 6.50 5.35 2.20 5.95 4.40 Bill Venables. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of pelt Sent: Thursday, 17 March 2011 12:28 AM To: r-help@r-project.org Subject: [R] making dataframes Dear all, I have a dataframe