6

Is in R the last result from the console saved in a variable that I can call?

For example, in Matlab I can use ans to refrence the last value:

enter image description here

Cettt
  • 11,460
  • 7
  • 35
  • 58
Frank
  • 541
  • 1
  • 6
  • 18

1 Answers1

18

yes there is, it is .Last.value:

> 4*5
[1] 20
> .Last.value * 5
[1] 100
Cettt
  • 11,460
  • 7
  • 35
  • 58