[R] insert number in vector

Juan Ramon Gonzalez jrgonzalez at ico.scs.es
Tue Jun 18 10:30:17 CEST 2002

Hello R-users,

I need to create a vector inserting an 1 after each value of another vector.
For example:


I need to create a vector with the values 2,1,3,1,4

Does anyone know how create this vector without loops (vec1 could have 1000

Thank you,


r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list