[R] Merging two columns of a data frame

From: Abraham Mathew <abmathewks_at_gmail.com>
Date: Thu, 28 Apr 2011 11:00:25 -0400

Hi folks, I have a simple question that I just can't solve.

I'm trying to merge two columns in my data frame.

> sessionInfo()

R version 2.13.0 (2011-04-13)
Platform: i686-pc-linux-gnu (32-bit)

> head(dat)

Year Month Number

2002   Jan       0
2002   Feb       0
2002   March    0
2002   April      1
2002   May      0
2002   June     0

I tried to do the following, but it doesn't work.

dat$Time <- merge(dat[,1], dat[,2])

Help, Abraham.

        [[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. Received on Thu 28 Apr 2011 - 16:45:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 28 Apr 2011 - 17:10:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive