Is there an expression in `R` to output the last command?

In Mathematica, the output of the last expression can be obtained using the % symbol. In particular, in Mathematica you can do the following:

 1+2 % / 3 

This will return output 1 , because the output of the first expression is 3, and 3/3 = 1 .

Is there equivalent functionality in R ?

+7
r
source share
1 answer

Here you go. Give it a try ? .Last.value ? .Last.value to find out more

 1 + 2 .Last.value /3 
+15
source share

All Articles