Displaying 20 results from an estimated 1000 matches similar to: "WISH: eval() to preserve the "visibility" (now value is always visible)"
2015 Feb 07
1
WISH: eval() to preserve the "visibility" (now value is always visible)
Would it be possible to have the value of eval() preserve the
"visibility" of the value of the expression?
"PROBLEM":
# Invisible
> x <- 1
# Visible
> eval(x <- 2)
[1] 2
"TROUBLESHOOTING":
> withVisible(x <- 1)
$value
[1] 1
$visible
[1] FALSE
> withVisible(eval(x <- 2))
$value
[1] 2
$visible
[1] TRUE
WORKAROUND:
eval2 <-
2013 Aug 14
2
Inconsistency between eval and withVisible (with patch)
R-team,
The $value element of the return value of *withVisible* does not agree with
the return value of *eval* when *withVisible* is passed a variable (symbol)
containing an expression object or anonymous code/expressions which
generates an expression object when evaluated (such as calls to *parse* or *
expression*).
I have attached a patch against the svn trunk which addresses this.
Example
2018 Mar 20
1
WISH: Sys.setlocale() to return value invisibly
Contrary to, say, Sys.setenv(), Sys.setlocale() returns it's value
visibly. This means that if you for instance add:
Sys.setlocale("LC_COLLATE", "C")
to your .Rprofile file, it will print:
[1] "C"
at startup. The workaround is to wrap the call in invisible(), but I'd
argue that any "setter" function should return invisibly.
Some more details:
2014 Jun 17
0
PATCH: Avoiding extra copies (NAMED bumped) with source(..., print.eval=FALSE) ...and with print.eval=TRUE?
OBJECTIVE:
To update source(..., print.eval=FALSE) to not use withVisible()
unless really needed. This avoids unnecessary increases of reference
counts/NAMED introduced by withVisible(), which in turn avoids
unnecessary memory allocations and garbage collection overhead. This
has an impact on all source():ed scripts, e.g. pre-allocation of large
matrices to save memory does *not always* help in
2016 Nov 15
2
Missing objects using dump.frames for post-mortem debugging of crashed batch jobs. Bug or gap in documentation?
Martin, thanks for the good news and sorry for wasting your (and others
time) by not doing my homework and query bugzilla first (lesson learned!
).
I have tested the new implementation from R-devel and observe a semantic
difference when playing with the parameters:
# Test script 1
g <- "global"
f <- function(p) {
l <- "local"
dump.frames()
}
2007 Apr 06
2
wishlist: additional argument in R_tryEval (Rinternals.h)
Hi,
R_tryEval, exported in Rinternals.h but not part of the API, is
currently defined as:
R_tryEval(SEXP e, SEXP env, int *ErrorOccurred);
I'm trying to embed R in an application (basically yet another GUI),
and this has been very helpful to catch errors. It would be even more
helpful if it also gave access to the visibility flag. I can wrap this
in a call to withVisible, and that works
2020 Jan 07
1
Another wish (?) for R 4.0.0: print(*, width = <n>)
On Tue, Jan 7, 2020 at 6:14 AM brodie gaslam via R-devel
<r-devel at r-project.org> wrote:
>
> For whatever my 2c are worth I think this would be nice. I'm still uncomfortable at having to call `options` in my package `diffobj` to set output width.
Adding a few more cents: It might be worth considering "who" should be
allow to control the 'width' argument. In
2018 Feb 06
1
gdistance::shortestPath throws error "not a symmetric matrix"
Hi,
Calling
gdistance::shortestPath
gives me the error
Error in asMethod(object) :
not a symmetric matrix; consider forceSymmetric() or symmpart()
The output of dput(.traceback()) is
pairlist("stop(\"not a symmetric matrix; consider forceSymmetric() or symmpart()\")",
"asMethod(object)",
"as(Laplacian,\"symmetricMatrix\")",
2013 Mar 19
1
source, sys.source and error line numbers
Hi,
is there a way to retrieve the line number of where en error occurred when
sourcing a file in a tryCatch statement? Is it stored somewhere accessible?
It is not found in the error object.
Consider the following code/output and note the difference in the traceback
between source (has line number) and sys.source (has no line number).
Thank you,
Renaud
########
# code
########
codefile <-
2012 Oct 19
2
setting option in function
is it possible to set an option inside a function ((I want to set
na.action = na.fail) and have the previous state restored if there is
an error so that the function doesn't change the option behind the
user's back?
Sorry if this has been answered before, but this subject is hard to Google.
--
Charles Geyer
Professor, School of Statistics
University of Minnesota
charlie at stat.umn.edu
2013 Jun 04
1
strange value in .Last.value
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:
2016 Sep 02
4
withAutoprint({ .... }) ?
On R-help, with subject
'[R] source() does not include added code'
>>>>> Joshua Ulrich <josh.m.ulrich at gmail.com>
>>>>> on Wed, 31 Aug 2016 10:35:01 -0500 writes:
> I have quantstrat installed and it works fine for me. If you're
> asking why the output of t(tradeStats('macross')) isn't being printed,
>
2012 Jan 11
2
Vegan(ordistep) error: Error in if (aod[1, 5] <= Pin) { : missing value where TRUE/FALSE needed
I am getting the following erro rmessage in ordistep. I have a number of
similarly structured datasets using ordistep in a loop, and the message
only occurs for some of the datasets.
I cannot include a reproducible sample - the specific datasets where this
is occur ing are fairly large and there are several pcnm's in the rhs of
the formula.
thanks for any pointers that may allow me to
2020 Jun 01
1
eval and Calling Frames
I ran into an interesting issue with `evalq` (and also
`eval(quote(...))`):
???? f <- function() {
?????? list(
???????? sys.parent(1),
???????? evalq(sys.parent(1)),
???????? evalq((function() sys.parent(2))()),? # add an anon fun layer
???????? evalq((function() sys.parent(1))())
?????? )
???? }
???? res <- f()
???? str(res)
???? ## List of 4
???? ##? $ : int 0???????? # sys.parent(1)
2016 Sep 02
1
withAutoprint({ .... }) ?
On 02.09.2016 14:38, Duncan Murdoch wrote:
> On 02/09/2016 7:56 AM, Martin Maechler wrote:
>> On R-help, with subject
>> '[R] source() does not include added code'
>>
>>>>>>> Joshua Ulrich <josh.m.ulrich at gmail.com>
>>>>>>> on Wed, 31 Aug 2016 10:35:01 -0500 writes:
>>
>> > I have quantstrat
2011 Jan 26
1
print() required sometimes in interactive use of console
Surprising behavior:
Most R users are aware that print()
must be used inside functions to gain
output on the console.
Apparently, print() is sometimes required
when interactively using the console.
For example, the followingmay be
entered into the R console with different results.
sample(1:8,8) #prints a permutation of 1 to 8
for(i in 1:5) #does not
sample(1:8,8)
2024 Oct 25
1
Could .Primitive("[") stop forcing R_Visible = TRUE?
? Fri, 25 Oct 2024 08:39:39 -0400
Duncan Murdoch <murdoch.duncan at gmail.com> ?????:
> Surely you or they should be the ones to run the test across all of
> CRAN?
That's fair. The question is, is there a fundamental reason I
overlooked to deny such a change? Except for positioning and
whitespace, the line has been in names.c since SVN revision 2. The
one regression test touched
2002 Sep 04
3
strange things with eval and parent frames
Dear mailing list,
I have found some strange behaviour which I think relates to parent frames
and eval. Can anyone explain what's going on here?
First example:
> test.parent.funcs_ function() {
outer.var_ 5
subfunc1_ function() substitute( outer.var, envir=parent.frame())
print( subfunc1())
subfunc2b_ function() eval( quote( outer.var), envir=parent.frame())
print(
2014 May 12
0
traceback does not show source line number of long calls when truncating output
Hi,
in R-3.1.0 (Linux), traceback() does not show the source file line
number for the truncated calls, when limiting the number of lines
output for each call with argument max.lines. See sample code, output
and session info below (in particular, output for call number 5).
I guess this is not intended.
Thank you.
Bests,
Renaud
####################
## File: traceback.R
a <- function(...){
2024 Oct 25
1
[External] Re: Could .Primitive("[") stop forcing R_Visible = TRUE?
On Fri, 25 Oct 2024, Ivan Krylov via R-devel wrote:
> ? Fri, 25 Oct 2024 08:39:39 -0400
> Duncan Murdoch <murdoch.duncan at gmail.com> ?????:
>
>> Surely you or they should be the ones to run the test across all of
>> CRAN?
>
> That's fair. The question is, is there a fundamental reason I
> overlooked to deny such a change? Except for positioning and
>