get xts objects from within an environment

后端 未结 2 1323
温柔的废话
温柔的废话 2021-01-13 21:38

I have stored xts objects inside an environment. Can I subset these objects while they are stored in an environment, i.e. act upon them \"in-place\"? Can I extract these obj

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-13 22:31

    If I'm reading the question correctly, you want smth like this:

    dtxl = do.call(cbind, sapply(tickers2,
               function(ticker) get(ticker, env=data)[paste(date.start,date.end,sep="/")])
           )
    

提交回复
热议问题