Re: [R] concatenating a string to a column

2010-11-09 Thread Santosh Srinivas
Try on these lines library(MASS) data(Boston) Boston$crim<-paste(Boston$crim,"Test",sep="-") -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of sachinthaka.abeyward...@allianz.com.au Sent: 10 November 2010 10:39 To: R-help Forum Subject

Re: [R] concatenating a string to a column

2010-11-09 Thread Peter Langfelder
On Tue, Nov 9, 2010 at 9:09 PM, 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="");

Re: [R] concatenating a string to a column

2010-11-09 Thread Michael Bedward
You want the paste command (cat is for printing to the console)... A$period <- paste(A$period, 0, sep="") Michael On 10 November 2010 16:09, 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 bu