Thanks everybody for their help but in this particular case I've found a very easy solution. Since the matrix is preallocated I don't really have to add a new column: given a matrix of NAs I can simply

m[,index][1:length(vec)] <- vec

Thanks again for your suggestions, they will be useful when I need to add a column to a data frame! ;)

Cheers,

Federico

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to