How to assign the result of the previous expression to a variable?

前提是你 提交于 2019-11-26 04:44:15

问题


Suppose I\'m using R\'s interactive console, and I\'ve just done something like this:

long_running_command()

That long-running command returns a value, and I\'ve just realized that I wanted to assign that value to a variable instead of discard it. So how can I get that value without running the command again? Is there a command like this?

result = get_last_return_value()

回答1:


.Last.value is an answer.

It was answered once but you have better title.



来源:https://stackoverflow.com/questions/3689279/how-to-assign-the-result-of-the-previous-expression-to-a-variable

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