Re: [R] Merge and specify column output order

2014-01-15 Thread arun
Hi, It would be better to post a reproducible example. set.seed(42)  df1 <- cbind(as.data.frame(matrix(sample(60,40,replace=TRUE),ncol=4)),date=seq(as.Date("2013-05-10"),length.out=10,by=1)) colnames(df1)[-5] <- paste0("mod",1:4)  set.seed(14)  df2 <- data.frame(obs=1:20,wy=sample(12,20,replac

[R] Merge and specify column output order

2014-01-15 Thread Janet Choate
Hi, i am merging two data frames of different time periods, so that the result contains data from both for the same time period. however, I want the result to output columns in a certain order. the common column between the two data frames is date. for example: df1 columns: mod1 mod2 mod3 mod4 d