Skip to content
Prev 302327 / 398503 Next

add vectors to multiple objects

On Fri, Aug 3, 2012 at 2:53 PM, John linux-user <johnlinuxuser at yahoo.com> wrote:
Like David, I find this still somewhat confusing, but perhaps this
will get you started:

a3 <- 1:4
b3 <- 6
c3 <- letters

a_new_thing <- do.call(list, lapply(ls(pattern = "3"), get))

old_thing <- list("cow")

a_longer_old_thing <- c(old_thing, a_new_thing)

adapt as needed.

Best,
Michael