[R] the value of the last expression

Sam Steingold sds at gnu.org
Mon Dec 10 20:13:22 CET 2012


> * Richard M. Heiberger <ezu at grzcyr.rqh> [2012-02-09 21:48:50 -0500]:
>
> .Last.value

Thanks; it worked for a while, but not anymore:

http://stat.ethz.ch/R-manual/R-patched/library/base/html/Last.value.html
--8<---------------cut here---------------start------------->8---
> gamma(1:15) 
 [1]           1           1           2           6          24         120
 [7]         720        5040       40320      362880     3628800    39916800
[13]   479001600  6227020800 87178291200
> z <- .Last.value
> z
NULL
--8<---------------cut here---------------end--------------->8---

could my .Rprofile be at fault?
--8<---------------cut here---------------start------------->8---
## breaks ess
## options(error = utils::recover)
options(max.print = 100, repos = c(CRAN = "http://lib.stat.cmu.edu/R/CRAN/"))
library(compiler)
compiler::enableJIT(3)
compiler::compilePKGS(1)
--8<---------------cut here---------------end--------------->8---


> On Thu, Feb 9, 2012 at 9:44 PM, Sam Steingold <sds at gnu.org> wrote:
>
>> Is there an analogue of common lisp "*" variable which contains the
>> value of the last expression?
>> E.g., in lisp:
>> > (+ 1 2)
>> 3
>> > *
>> 3
>>
>> I wish I could recover the value of the last expression without
>> re-evaluating it.

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://mideasttruth.com http://thereligionofpeace.com
http://www.memritv.org http://iris.org.il http://americancensorship.org
Diplomacy is the art of saying "nice doggy" until you can find a nice rock.



More information about the R-help mailing list