[R] Concatenating variables

Liaw, Andy andy_liaw at merck.com
Wed Aug 4 22:25:09 CEST 2004


Try something like:

paste(tenn$up, tenn$down, tenn$stable, collapse="")

HTH,
Andy

> From: Doran, Harold
> 
> Hi all:
> 
>  
> 
> I'm having difficulty with something I believe is very simple, but I'm
> stuck. I have a large data frame that took days to clean and prepare.
> All I now need to do is concatenate three variables into a single
> column. For example, I have tenn$up, tenn$down, and tenn$stable which
> all have values of 1 or 0. I simply want to put all three columns
> together to create a pattern (e.g., 111, 101, 001).
> 
>  
> 
> I tried c(tenn$up,tenn$down,tenn$stable)
> 
>  
> 
> But this isn't working. Thanks for any help offered.
> 
>  
> 
> Harold
> 
>  
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>




More information about the R-help mailing list