如何将前一个表达式的结果分配给变量? [英] How to assign the result of the previous expression to a variable?
本文介绍了如何将前一个表达式的结果分配给变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我正在使用R的交互式控制台,而我刚刚做过这样的事情:
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()
推荐答案
。最后一个值
是答案。
已回答一次,但您的标题更好。
这篇关于如何将前一个表达式的结果分配给变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文