15

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

1+2
% / 3

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

Is there an equivalent functionality in R?

merlin2011
  • 71,677
  • 44
  • 195
  • 329
  • Ideally, it would be tied to the current environment, so it should work in a sourced script but not leak outside a function. If that's not possible, interactively at the console is certainly better than not having it at all. – merlin2011 Nov 17 '13 at 02:38

1 Answers1

26

Here you go. Try ? .Last.value to learn more

1 + 2
.Last.value /3
Ramnath
  • 54,439
  • 16
  • 125
  • 152