10:39
To: R-help Forum
Subject: [R] concatenating a string to a column
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$per
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="");
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
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="");
Any help would be appreciated.
Thanks,
Sachin
p.s.
4 matches
Mail list logo