Displaying 20 results from an estimated 10000 matches similar to: "Active bindings in attached environments"
2009 Mar 16
1
Using and 'eval' and environments with active bindings
The following code produces an error in current R-devel
f <- function(value) {
if(!missing(value))
100
else
2
}
e <- new.env()
makeActiveBinding("x", f, e)
eval(substitute(list(x)), e)
The error, after calling 'eval' is
Error in eval(expr, envir, enclos) :
element 1 is empty;
the part of the args list of 'list'
2011 Apr 12
2
parse_Rd raises error when example section contains a quoted percent character
I was writing Rd documentation for a new package when I came across
this issue. Here's the smallest example:
> library(tools)
> cat("\\examples{x <- '<%=rnorm(1)%>'}\n",file=file.path(tempdir(),'test.Rd'))
> readLines(file.path(tempdir(),'test.Rd'))
[1] "\\examples{x <- '<%=rnorm(1)%>'}"
>
2020 May 24
1
Surpising behavior when using an active binding as loop index in R 4.0.0
A shorter reproducible example:
example(makeActiveBinding)
for (fred in 1:3) { 0 }
ls()
Both problems go away if you first do
compiler::enableJIT(2)
So looks like a bug in compiling the for loop.
-Deepayan
On Sat, May 23, 2020 at 5:45 PM Thomas Friedrichsmeier via R-devel
<r-devel at r-project.org> wrote:
>
> Possibly just a symptom of the earlier behavior, but I'll amend my
2020 May 23
2
Surpising behavior when using an active binding as loop index in R 4.0.0
Hi,
I stumbled upon a surprising behavior when using an active binding as a
loop index variable in R 4.0.0. In contrast, the behavior observed in R
3.6.1 is in line with my expectations.
Consider the code below:
makeActiveBinding("i",
function(value) {
if (missing(value)) {
x
} else {
print("set")
x <<- value
}
}, globalenv())
i <- 1 # output
2011 Feb 03
2
Creating a reference class object from a class definition in a package fails
Hi,
I'm trying to create a package that contains reference class
definitions from which users can create reference objects, but there
seems to be something awry.
My toy example creates an empty package via
package.skeleton('TestClass') to which I add the following R code:
TestClass <- setRefClass('TestClass',fields=c('name'))
Unfortunately my R console output
2010 Jan 06
1
MakeActiveBinding help needed
Hi,
I wanted a Q&D way to open a new graphics window but keep the focus in
the console window (under Windows and the Rgui), so I wrote a line into
my Rprofile.site file as follows:
invisible(makeActiveBinding('newdev', function(...)
dev.new(restoreConsole=T), .GlobalEnv))
(That is all on one line, incase the mailer re-parses it). This gives me
a command "newdev" which
2005 Apr 06
1
makeActiveBinding warning
A while ago Luke Tierney remarked that the warning associated with
'makeActiveBinding'-- "saved workspaces with active bindings may not
work properly when loaded into older versions of R"-- should probably be
removed in R-devel. It's still cropping up *sporadically* with R-alpha
of 3/4/2004, but not every time I call 'makeActiveBinding'.
So, two questions:
(i) is it
2011 Apr 06
0
Activating a Regular Binding
Greeting R-devel,
I find myself wanting to attach an active binding to an existing
object in the global environment (R 2.12.2), but there doesn't seem to
be an easy way to do this:
> x = 5
> makeActiveBinding("x", function(d) "hi", .GlobalEnv)
Error in makeActiveBinding("x", function(d) "hi", .GlobalEnv) :
symbol already has a regular binding
2006 Oct 05
1
littler release 0.0.6
What ?
------
We are pleased to announce version 0.0.6 of littler
What's new ?
------------
This version includes a bug fix or two as well as a number of small
enhancements to the documentation.
For OS X and the r/R confusion, our recommended suggestion is to call
configure using either the --program-suffix=X or --program-prefix=Y
option to have the binary and manual
2006 Sep 29
1
Possible bug in Rcons_vprintf
In R-2-4-branch r39548, Rcons_vprintf is called from stdout_vfprintf
when R_Outputfile is NULL. When called and output is greater than
R_BUFSIZE, output is truncated to R_BUFSIZE. Here's a one-line fix:
Index: src/main/printutils.c
===================================================================
--- src/main/printutils.c (revision 39548)
+++ src/main/printutils.c (working
2009 Jun 29
1
active bindings and ls.str
Hello,
Should active binding appear as such in ls.str.
> makeActiveBinding( "xx", function(arg){ Sys.sleep(10) }, .GlobalEnv )
> ls.str() # takes 10 seconds
xx : NULL
What we see here is the result of the "setter" of the binding.
I'm attaching a patch that prints this instead:
> ls.str()
xx : <active binding>
Although a better behaviour would be to
2010 Jul 02
2
Best way to determine if you're running 32 or 64 bit R on windows
Hi,
Is this sufficient?
if (.Machine$sizeof.pointer==4){
cat('32\n')
} else {
cat('64\n')
}
Or is it better to test something in R.version, say os?
I'd like to use this to specify appropriate linker arguments when
building the RMySQL windows package.
Jeff
--
http://biostat.mc.vanderbilt.edu/JeffreyHorner
2008 Jul 24
3
Should this PDF render correctly without font embedding?
A professor here at Vanderbilt sent me the following code. Each of the
text strings should right justify against the center vertical bar, but
because of font issues it doesn't. I understand that there are
workarounds, but I was just curious if this was consistent across all
platforms. On linux with R 2.7.1 and R-trunk (r46103), both acrobat
reader 8 and kpdf render it incorrectly. How
2007 Mar 28
1
checking existence of active bindings
Is there any way to check whether an active binding exists without
actually calling the active binding? I'd like to be able to do
something like exists("x", ...) and know whether "x" exists without
actually fetching its value if it is an active binding (because it could
consume significant resources to fetch the value).
The documentation for exists() doesn't
2008 Sep 04
1
Possible R graphics devices
Hello all,
I've been working on a new R Graphics device that targets Adobe's
Shockwave Flash format (SWF for short). It uses http://www.libming.org/
on the backend. Here are some example outputs so far:
http://160.129.129.41/~hornerj/plots/
Once you click on the above, choose a directory like 'smooth' and then
click on test.html to see a side-by-side comparison of the swf
2013 Nov 16
2
serialization for external pointers
Hello,
Are there any recipe to handle serialization / deserialization of
external pointers.
I'm thinking about something similar in spirit to the way we handle
finalization of external pointers.
Currently, if we create an external pointer, save the session, quit R,
then load the session, we get a null pointer.
One way I'm thinking of is to have an environment in the
2009 Mar 31
3
RMySQL compile
I am trying to install RMySQL on OpenSolaris and need to pass some options
to configure.
Tried the 3 recommended ways of doing it and nothing works, configure
cannot
find the headers and the libs.
I ran configure manually and that worked fine
./configure CC=cc CFLAGS="-dalign -KPIC -xlic_lib=sunperf"
LDFLAGS="-L/usr/sfw/lib
2007 Jul 07
1
R graphics device for flash apps
Byron,
I just read your blog (statcomp.blogspot.com, linked from your other
post) and rand across your idea of an R/Flash graphics device. I've also
been giving this some thought because of this amazing interactive flash app:
http://tools.google.com/gapminder
and others from http://www.gapminder.org/.
I would love more than anything to work on this. The only hitch is that
I'm so
2010 Oct 01
2
Will PrintWarnings remain non static?
Hi,
The C function PrintWarnings is currently not in the C API, but it is
declared non static in the svn trunk as of revision 53110 . As this is
the only function that creates the last.warning object used by the R
function warnings(), I think it would be useful for programs that
embed R to be able to call it.
So, will it remain non static, that is callable although it's not
declared in the
2007 Mar 24
2
Subtle bug in do_basename
Hello,
I've been wondering why my no-optimization R-devel builds have been
hanging during "building/updating package indices ...". I tracked it
down with gdb to this line from do_basename in utils.c:
while ( *(p = buf + strlen(buf) - 1) == fsp ) *p = '\0';
Now, imagine if your compiler places the variable fsp immediately before
buf on the stack, and strlen(buf) is 0.