This question already has an answer here:
这个问题在这里已有答案:
- Equivalent of matlab 'ans' in R [duplicate] 2 answers
- 相当于R [复制] 2答案中的matlab'ans'
- Capture last output as an R object [duplicate] 1 answer
- 将最后一个输出捕获为R对象[复制] 1个答案
In Mathematica, the output of the last expression can be accessed using the symbol %
. In particular, one can do the following in Mathematica:
在Mathematica中,可以使用符号%访问最后一个表达式的输出。特别是,可以在Mathematica中执行以下操作:
1+2
% / 3
This will return the output 1
, because the output of the first expression is 3, and 3/3 = 1
.
这将返回输出1,因为第一个表达式的输出是3,而3/3 = 1。
Is there an equivalent functionality in R
?
R中是否有相同的功能?
1 个解决方案
#1
18
Here you go. Try ? .Last.value
to learn more
干得好。试试? .Last.value了解更多信息
1 + 2
.Last.value /3
#1
18
Here you go. Try ? .Last.value
to learn more
干得好。试试? .Last.value了解更多信息
1 + 2
.Last.value /3