Displaying 20 results from an estimated 10000 matches similar to: "Reference classes and ".requireCachedGenerics""
2011 May 04
1
General "nil" reference class object
Dear John and others,
I've been wondering about whether there's any way to indicate a "nil"
reference class object, which will represent "no value", and be tested
for, but not fail the internal type checking. NULL is the obvious
choice (or seems so to me), but can only be used if an explicit class
union is created:
> Foo <- setRefClass("Foo")
> Bar
2011 Mar 29
2
Reading 64-bit integers
Dear all,
I see from some previous threads that support for 64-bit integers in R
may be an aim for future versions, but in the meantime I'm wondering
whether it is possible to read in integers of greater than 32 bits at
all. Judging from ?readBin, it should be possible to read 8-byte
integers to some degree, but it is clearly limited in practice by R's
internally 32-bit integer type:
2010 Oct 22
1
Reference classes
Dear all,
First, many thanks to John Chambers, and anyone else who was involved,
for the new support for "reference classes" in R 2.12.0. It's nice to
see this kind of functionality appear in a relatively R-like form, and
with the blessing of the core team. In some contexts it is undoubtedly
appealing to associate a set of methods with a class directly, rather
than defining a load
2011 Feb 16
1
Ignoring .Rprofile when installing a package
Dear all,
Is there a way to force R CMD INSTALL to ignore ~/.Rprofile and
similar? I presume it sources these startup files for a reason, but
I've found that it can cause confusion or problems. In particular, my
~/.Rprofile loads a few packages which I very frequently use, but this
stops me from installing new versions of their dependencies; viz.
$ R CMD INSTALL tractor.base
* installing to
2011 Mar 09
2
system(..., invisible=FALSE, show.output.on.console=FALSE) in Windows 7
Hello,
I work for a company in which a number of employees use R. Many of them like to run executables via the system function in such a way that the output of that executable is displayed in a separate window. To give an example of the behavior they require, the following command can be run in R GUI:
system("cmd",invisible=FALSE,show.output.on.console=FALSE)
The result is that a
2015 Jul 28
2
all.equal: possible mismatch between behaviour and documentation
Dear all,
The documentation for `all.equal.numeric` says
Numerical comparisons for ?scale = NULL? (the default) are done by
first computing the mean absolute difference of the two numerical
vectors. If this is smaller than ?tolerance? or not finite,
absolute differences are used, otherwise relative differences
scaled by the mean absolute difference.
But the actual behaviour
2010 Jul 16
2
Creating an environment with attributes in a package
Dear all,
I am trying to create an environment object with additional attributes, viz.
Foo <- structure(new.env(), name="Foo")
Doing this in a standard session works fine: I get the environment
with attr(,"name") set as expected. But if the same code appears
inside a package source file, I get just the plain environment with no
attributes set. Using a non-environment
2008 Apr 28
4
R 2.7.0, match() and strings containing \0 - bug?
Hi,
A piece of my code that uses readBin() to read a certain file type is
behaving strangely with R 2.7.0. This seems to be because of a failure
to match() strings after using rawToChar() when the original was
terminated with a "\0" character. Direct equality testing with ==
still works as expected. I can reproduce this as follows:
> x <- "foo"
> y <-
2009 Feb 04
2
Capturing all warnings (with messages)
Dear all,
For an open-source project that I'm working on (1), which uses R for
all its heavy lifting but includes a wrapper shell script, I was
hoping to find a way to capture all warnings (and, in fact, errors
too), and handle them in my own way. I realise I can do this for a
single expression using something like:
> f <- function(w) print(w$message)
>
2009 Aug 11
1
readBin() arg check has unnecessary overhead (patch included)
Dear all,
The version of readBin() in R-devel includes a use of match(), through
`%in%`, which can affect its performance significantly. By using
primitives instead of the rather expensive call to match(), I reduce
the time spent inside readBin() by more than 30% in some of my code
(part of the tractor.base package). A simple patch that does this is
given below. This passes "make
2015 Jul 30
1
all.equal: possible mismatch between behaviour and documentation
Dear Jon,
thank you for raising the issue,
>>>>> Jon Clayden <jon.clayden at gmail.com>
>>>>> on Tue, 28 Jul 2015 12:14:48 +0100 writes:
> Sorry; minor clarification. The actual test criterion in the example I
> gave is of course abs((0.1-0.102)/0.1) < 0.01, not abs(0.1) < 0.01. In
> any case, this does not match (my reading of) the docs,
2011 Mar 07
1
WG: Reference classes: error with missing arguments in method calls
Dear list,
a while ago I posted this at r-devel but got no answers. Hope it?s okay to
give it a shot again by cross-posting it here.
TIA for any comments,
Janko
Von: Janko Thyson [mailto:janko.thyson.rstuff at googlemail.com]
Gesendet: Montag, 21. Februar 2011 00:58
An: r-devel at r-project. org (r-devel at r-project.org)
Betreff: Reference classes: error with missing arguments in method calls
2011 Feb 20
0
Reference classes: error with missing arguments in method calls
Dear list,
I'm having problems in understanding an error that pops up in the context of
missing arguments with methods of reference class objects.
Because of the following statement taken from '?referenceClass', my ref
class methods call explicit S4 methods:
"Reference methods should be kept simple; if they need to do some
specialized R computation, that computation
2011 Mar 15
1
Bug in lattice auto.key argument
The Lattice auto.key argument has a bug in R.12.2.
R version 2.12.2 (2011-02-25)
Platform: i386-pc-mingw32/i386 (32-bit)
....
other attached packages:
[1] lattice_0.19-17
loaded via a namespace (and not attached):
[1] grid_2.12.2
If I set up my plot parameters as
require(lattice)
superpose.line.settings <- trellis.par.get("superpose.line")
str(superpose.line.settings)
2011 May 04
1
Error Rscript: No such file or directory
Hello,
I'm trying to build a simple cpp file using the R CMD SHLIB command and I always
receive the same error message:
cygwin warning:
MS-DOS style path detected: C:/PROGRA~1/R/R-212~1.1/etc/i386/Makeconf
Preferred POSIX equivalent is:
/cygdrive/c/PROGRA~1/R/R-212~1.1/etc/i386/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult
2008 Sep 24
2
R --interactive and readline() creates infinite loop
Dear all,
I have asked before, in R-help [1], about a way to create an
interactive session in which commands are taken from a file or
standard input - like R CMD BATCH but additionally allowing user input
- but there was no response to that question, and the workarounds that
I have found (using "expect", creating a temporary .Rprofile) are ugly
and problematic.
With the
2012 Oct 23
1
Mirror of the R manuals with a new visual style
Dear all,
I've created a new mirror of the HTML versions of the main R manuals
at <http://r-manuals.flakery.org>. This mirror does not modify the
content of the manuals at all, but simply injects a new visual style
with the aim of making the text easier to read and navigate. It will
be updated after each release of R.
The code used to generate these versions is freely available at
2011 Sep 23
2
Issue with seek() on gzipped connections in R-devel
Dear all,
In R-devel (2011-09-23 r57050), I'm running into a serious problem
with seek()ing on connections opened with gzfile(). A warning is
generated and the file position does not seek to the requested
location. It doesn't seem to occur all the time - I tried to create a
small example file to illustrate it, but the problem didn't occur.
However, it can be seen with a file I use for
2011 Feb 28
2
broken link on CRAN
The link to
http://cran.r-project.org/bin/macosx/R-2.12.1.pkg
on the CRAN page
http://cran.r-project.org/bin/macosx/
is broken. Also, the email address for the webmaster is null (which is
why I'm emailing here).
Thanks,
Max
2007 Jan 26
1
readBin is much slower for raw input than for a file
Dear all,
I'm trying to write an efficient binary file reader for a file type
that is made up of several fields of variable length, and so requires
many small reads. Doing this on the file directly using a sequence of
readBin() calls is a bit too slow for my needs, so I tried buffering
the file into a raw vector and reading from that ("loc" is the
equivalent of the file pointer):