[R] Reduce(paste, x) question

mdvaan mathijsdevaan at gmail.com
Thu Nov 1 21:06:58 CET 2012


I should have been more specific:

y <- list()
a <- c("A", "K")
b <- c("B", "L")
c <- c("C", "M")
d <- c("D", "N")
e <- c("E", "O")

y[[1]] <- a
y[[2]] <- b
y[[3]] <- c
y[[4]] <- d
y[[5]] <- e

y
[[1]]
[1] "A" "K"

[[2]]
[1] "B" "L"

[[3]]
[1] "C" "M"

[[4]]
[1] "D" "N"

[[5]]
[1] "E" "O"

How do I get a list object like y (each element of y is a vector of strings)
from:

x[[1]] <- LETTERS[1:5]
x[[2]] <- LETTERS[11:15]

using only the Reduce function?

Thanks!



--
View this message in context: http://r.789695.n4.nabble.com/Reduce-paste-x-question-tp4648151p4648169.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list