On Tue, Nov 9, 2010 at 9:09 PM, <sachinthaka.abeyward...@allianz.com.au> wrote: > > Hi All, > > Suppose I want to concatenate a zero to all the values to a column called > period in data frame A. I want to do the following but the following > command actually deletes the entire column altogether. > > A$period<-cat(A$period,"0",sep="");
cat returns NULL, so you get NULL in A$period. try A$period<-paste(A$period,"0",sep=""); Of course, if A$period are integer numbers, a simple way of adding a zero is to multiply everything by 10. Peter ______________________________________________ R-help@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.