Skip to content

the value of the last expression

5 messages · Sam Steingold, arun, R. Michael Weylandt +1 more

#
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---
[1]           1           1           2           6          24         120
 [7]         720        5040       40320      362880     3628800    39916800
[13]   479001600  6227020800 87178291200
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---

  
    
#
HI,


It is working for me.
? 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
# [1]?????????? 1?????????? 1?????????? 2?????????? 6????????? 24???????? 120
?#[7]???????? 720??????? 5040?????? 40320????? 362880???? 3628800??? 39916800
#[13]?? 479001600? 6227020800 87178291200

sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
?[1] LC_CTYPE=en_US.UTF-8?????? LC_NUMERIC=C????????????? 
?[3] LC_TIME=en_US.UTF-8??????? LC_COLLATE=en_US.UTF-8??? 
?[5] LC_MONETARY=en_US.UTF-8??? LC_MESSAGES=en_US.UTF-8?? 
?[7] LC_PAPER=C???????????????? LC_NAME=C???????????????? 
?[9] LC_ADDRESS=C?????????????? LC_TELEPHONE=C??????????? 
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C?????? 

attached base packages:
[1] stats???? graphics? grDevices utils???? datasets? methods?? base???? 

other attached packages:
[1] matrixStats_0.6.2 stringr_0.6?????? reshape_0.8.4???? plyr_1.7.1?????? 

loaded via a namespace (and not attached):
[1] R.methodsS3_1.4.2 tools_2.15.0????
A.K.




----- Original Message -----
From: Sam Steingold <sds at gnu.org>
To: r-help at r-project.org; Richard M. Heiberger <rmh at temple.edu>
Cc: 
Sent: Monday, December 10, 2012 2:13 PM
Subject: Re: [R] the value of the last expression
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---
[1]? ? ? ? ?  1? ? ? ? ?  1? ? ? ? ?  2? ? ? ? ?  6? ? ? ? ? 24? ? ? ?  120
[7]? ? ? ?  720? ? ? ? 5040? ? ?  40320? ? ? 362880? ?  3628800? ? 39916800
[13]?  479001600? 6227020800 87178291200
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---

  
    
#
I do not claim to have found a bug.
I am merely pleading for help figuring out what could have gone wrong.
.Last.value word when I first start R under Emacs/ESS.
Then it stops working.
I can't figure out when or why...

--8<---------------cut here---------------start------------->8---
R version 2.15.2 (2012-10-26)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  compiler  methods  
[8] base     

loaded via a namespace (and not attached):
[1] tools_2.15.2
--8<---------------cut here---------------end--------------->8---

  
    
#
On Mon, Dec 10, 2012 at 7:13 PM, Sam Steingold <sds at gnu.org> wrote:
That's certainly odd.... I don't see anything in your .Rprofile which
raises red flags, but you can confirm by running

R --vanilla

which will ignore all environment settings, .*(rc|profile), saved sessions etc.

I presume you've tested in a fresh session and seen this behavior
consistently? If so, could you provide your sessionInfo() and source
of the binary you're using.
#
On 10/12/2012 2:37 PM, Sam Steingold wrote:
Use the usual debugging strategy:  simplify things.  Do you see the 
problem when you're running plain R, with no ESS?  Do you see the 
problem when you run R with the --vanilla option?  Do you have a script 
that reliably causes the failure?  Simplify it to a minimal script that 
causes the failure.

If you don't have a reproducible script yet to cause the error, then 
work on creating one.  (The next time you see it, save the entire 
history of the session, and see if re-running that history in a new 
session will reproduce the error.)

Duncan Murdoch