Capture last output as an R object [duplicate]

北慕城南 提交于 2019-12-01 01:01:56

问题


Possible Duplicate:
How to assign the result of the previous expression to a variable in R?

I'm working with R in ESS and just made the stupid mistake of running a long running function without assigning the result to a variable. So, it just printed out the result, a long string of output that looks like:

[[1]]
1 FALSE
[[2]]
1 TRUE
[[3]]
1 TRUE
[[4]]
1 TRUE 

Is there any way to coerce this printed output into an R object? Either within R, or using emacs (M-x undo-my-stupid-mistake)?


回答1:


Maybe this will work:

out <- .Last.value


来源:https://stackoverflow.com/questions/8735365/capture-last-output-as-an-r-object

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!