Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of matlab 'ans' in R [duplicate]

Tags:

r

matlab

In matlab, you can re-use the result of the (non affected) preceding calculous: it is stored in variable ans. Does R has something equivalent ?

like image 880
robin girard Avatar asked Jun 21 '10 07:06

robin girard


2 Answers

.Last.value 

See also this and this

like image 129
George Dontas Avatar answered Sep 25 '22 19:09

George Dontas


The value of the internal evaluation of a top-level R expression is always assigned to .Last.value before further processing.

like image 32
rcs Avatar answered Sep 21 '22 19:09

rcs