Expand Observations in New Column Based on Two Columns

#1
Hi

I have read a csv file using the read.table function into R. It contains a list of variables which are numeric in class.

I would like to create a new column based on two columns. Se example below, where C is my desired output.

A B C
1 4 4
2 3 3
3 4 3
2 5 4
- - 4
- - 4
- - 5
- - 5

Is there a clever way of doing this? I don't need to create any output for columns A and B, just a new columns C.
I can't seem to find a function that does this, but I did stumble across the reshape package.

Thanks in advance
 

trinker

ggplot2orBust
#4
The poster answered their own question. The use of cbind does not address the poster's problem. Unless I misunderstand the problem here's an example to see what they were after:

Code:
dat <- data.frame(var1=LETTERS[1:3], var2=c(3, 5, 2))
with(dat, rep(var1, var2))