Skip to content

R combining many vectors of predictable name into one date frame

2 messages · Mathew Vickers, Rui Barradas

1 day later
#
Hello,

Try the following.


ib1 <- 1:10
ib2 <- rnorm(10)

hold.list <- objects(pattern="ib")
df <- sapply(hold.list, get)
df


Note that you don't need list(), and that sapply() returns a data.frame 
if possible.

Also, 'df' is the name of an R function, use something else like 'df1'.

Hope this helps

Rui Barradas

Em 14-07-2012 00:51, Mathew Vickers escreveu: