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 remove
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 Zhangseane...@gmail.com wrote:
Dear R-helpers:
I have a question related to using do.call to call cbind and get.
#the following
2 matches
Mail list logo