[R] Merge two variables together

jim holtman jholtman at gmail.com
Wed Apr 1 02:08:57 CEST 2009


try this:

> v1<-c(2,4,2,3,7,8)
> v2<-c(0,0,0,0,0,0)
> as.vector(rbind(v1,v2))
 [1] 2 0 4 0 2 0 3 0 7 0 8 0


On Tue, Mar 31, 2009 at 7:46 PM, jimdare <jamesdare26 at gmail.com> wrote:
>
> Hello,
>
> If I have two variables:
>
> v1<-c(2,4,2,3,7,8)
> v2<-c(0,0,0,0,0,0)
>
> how can I merge them to form
>
> v3<-2,0,4,0,2,0,3,0,7,0,8,0
>
> I am trying to use this to get an xyplot to label every second x tick mark
> (i.e. by replacing v1 with every second year and v2 with "").
> --
> View this message in context: http://www.nabble.com/Merge-two-variables-together-tp22817164p22817164.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?




More information about the R-help mailing list