Buenas:
Otra forma usando indexación de vectores es:
> a <- c("a", "b", "c")
> e <- numeric(length(a)*5)
> e[seq(1, length(a)*5, 5)] <- a
> e
[1] "a" "0" "0" "0" "0" "b" "0" "0" "0" "0" "c" "0" "0" "0" "0"
Un saludo.
Buenas:
Otra forma usando indexación de vectores es:
> a <- c("a", "b", "c")
> e <- numeric(length(a)*5)
> e[seq(1, length(a)*5, 5)] <- a
> e
[1] "a" "0" "0" "0" "0" "b" "0" "0" "0" "0" "c" "0" "0" "0" "0"
Un saludo.