determining name of object loaded in R

Imagine you have an object `foo` that you saved as `saved.file.rda` as follows: foo <- 'a' save(foo, file='saved.file.rda') Suppose you load `saved.file.rda` into an environment with multiple objects but forgot the name of the object that is in `saved.file.rda`. Is there a way in R to determine that name? You can do it the following way, which seems a little clunky: bar <- load('saved.file.rda') eval(parse(text=bar)) # this will pull up the object that was in saved.file.rda However, is there a better way of doing this?
Just to clarify: you want name of object ("foo") or/and value of object ("a")?

以上就是determining name of object loaded in R的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准