Skip to content
Prev 177292 / 398506 Next

Extending a vector to length n

The following approach works for both of your examples:

xx <- rep(x, length.out=n)
xx[m:n] <- NA

Thus:
[1] "2008-01-01" NA
[1] a    <NA>
Levels: a
R. Raubertas
Merck & Co
Notice:  This e-mail message, together with any attachme...{{dropped:12}}