[R] How to retrieve results of most recent command?

Barry Rowlingson B.Rowlingson at lancaster.ac.uk
Fri Sep 22 17:58:42 CEST 2006


Yeh, Richard C wrote:
> In R, is there an automatic variable that stores the results of the most
> recent command or commands?  (I am thinking of a behavior like
> Mathematica's % result-history substitution syntax.)
> 

Something like .Last.value:

  > x=sqrt(2)
  > .Last.value
  [1] 1.414214

which might get more usage if it was less fiddly to type.


Barry



More information about the R-help mailing list