Use lapply(ColNameVec, get, environment())
so that it gets the objects from the current
environment. See: ?get ?environment
On Sun, Jul 26, 2009 at 11:16 PM, Sean Zhang wrote:
> Dear R-helpers:
> I have a question related to using do.call to call cbind and get.
>
> #the following works
> vec1 <- c
Dear R-helpers:
I have a question related to using do.call to call cbind and get.
#the following works
vec1 <- c(1,2)
vec2 <- c(3,4)
ColNameVec <- c('vec1','vec2')
mat <- do.call("cbind",lapply(ColNameVec,get))
mat
#put code above into a function then it does not work
#before doing so, first remo
2 matches
Mail list logo