[R] Combining columns of different length

Federico Gherardini f.gherardini at pigrecodata.net
Tue Oct 26 15:46:08 CEST 2004


Hi all,

Simple and direct question....
Is it possible to add a shorter column to a data frame or matrix in such 
a way that the missing values are replaced with NAs?
For example suppose I have

3   2
4   2
5   8

and I want to add a column

3
3

to get...

3   2   3
4   2   3
5   8   NA

Thanks

Federico




More information about the R-help mailing list