From winstonchang1 at gmail.com  Tue Jun  4 22:50:38 2013
From: winstonchang1 at gmail.com (Winston Chang)
Date: Tue, 4 Jun 2013 15:50:38 -0500
Subject: [Rd] strange value in .Last.value
In-Reply-To: <87wqq94o95.fsf@med.uni-goettingen.de>
References: <87wqq94o95.fsf@med.uni-goettingen.de>
Message-ID: <CAFOpNVF1=rgn6SUD9Cu7LyoFR01d_OoNj5k-two3Bua4XP3rUw@mail.gmail.com>

This is the result of the withVisible() function, which is called by
source(). This should illustrate what it does:

> withVisible(1+1)
$value
[1] 2

$visible
[1] TRUE


> withVisible(invisible(1+1))
$value
[1] 2

$visible
[1] FALSE

-Winston

On Tue, Jun 4, 2013 at 3:25 PM, Andreas Leha
<andreas.leha at med.uni-goettingen.de> wrote:
> Hi all,
>
> the .Last.value sometimes contains a strange $visible FALSE value.  This
> poses problems when using R with ESS (and ess-developer-mode) from
> within org-mode.
>
>
> >From http://permalink.gmane.org/gmane.emacs.ess.general/7299:
>
> --8<---------------cut here---------------start------------->8---
> Here is how to reproduce. Put df <- data.frame(a=1:3, b=1:3) in test.R
> and then:
>
>    source("test.R")
>    print(.Last.value)
>
> you should get:
>
>    $value
>      a b
>    1 1 1
>    2 2 2
>    3 3 3
>
>    $visible
>    [1] FALSE
> --8<---------------cut here---------------end--------------->8---
>
>
> Regards,
> Andreas
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] strange value in .Last.value
Winston Chang