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