Displaying 20 results from an estimated 10000 matches similar to: "is.environment, as.environment, and NULL"
2003 Jan 20
0
UseMethod change; isas-tests; all.equal
I was a little optimistic that the modified version passed _all_ the
tests. When I installed the complete change, all the fullcheck tests
passed except two, demos and isas-tests.
There is a tiny difference in the output of the demos test, where the
previous demos.Rout had what looks like an unwanted piece of output,
printing an attribute "legend" after doing
symnum(summary(detg.mod,
2003 Jan 21
0
UseMethod; all.equal; isas-tests
1. UseMethod (via usemethod in objects.c) now uses the definition of
class() to dispatch, with the methods package attached (dataClass(x))
and without (attr(x, "class")).
Packages using a construction of the form
if(is.null(class(x))) class(x) <- data.class(x)
UseMethod("foo")
should now get similar dispatch with the methods package attached.
2. all.equal and some of its
2009 Mar 03
1
profiler and loops
Hello,
(This is follow up from this thread:
http://www.nabble.com/execution-time-of-.packages-td22304833.html but
with a different focus)
I am often confused by the result of the profiler, when a loop is
involved. Consider these two scripts:
script1:
Rprof( )
x <- numeric( )
for( i in 1:10000){
x <- c( x, rnorm(10) )
}
Rprof( NULL )
print( summaryRprof( ) )
script2:
2024 Apr 25
1
Big speedup in install.packages() by re-using connections
On Thu, 25 Apr 2024 14:45:04 +0200
Jeroen Ooms <jeroenooms at gmail.com> wrote:
> Thoughts?
How verboten would it be to create an empty external pointer object,
add it to the preserved list, and set an on-exit finalizer to clean up
the curl multi-handle? As far as I can tell, the internet module is not
supposed to be unloaded, so this would not introduce an opportunity to
jump to an
2012 Nov 15
1
bug with mapply() on an S4 object
Hi,
Starting with ordinary vectors, so we know what to expect:
> mapply(function(x, y) {x * y}, 101:106, rep(1:3, 2))
[1] 101 204 309 104 210 318
> mapply(function(x, y) {x * y}, 101:106, 1:3)
[1] 101 204 309 104 210 318
Now with an S4 object:
setClass("A", representation(aa="integer"))
a <- new("A", aa=101:106)
> length(a)
2010 Aug 21
1
Speed improvement to evalList
I've been inspired to look at the R source code by some strange timing
results that I wrote about on my blog at radfordneal.wordpress.com
(see the posts on "Speeding up parentheses..." and "Two surprising
things...".
I discovered that the strange speed advantage of curly brackets over
parentheses is partially explained by an inefficiency in the evalList
and
2024 Apr 25
1
Big speedup in install.packages() by re-using connections
I'd like to raise this again now that 4.4 is out.
Below is a more complete patch which includes a function to properly
cleanup libcurl when R quits. Implementing this is a little tricky
because libcurl is a separate "module" in R, perhaps there is a better
way, but this works:
view: https://github.com/r-devel/r-svn/pull/166/files
patch:
2009 Dec 16
2
What is the fastest way to see what are in an RData file?
Currently, I load the RData file then ls() and str(). But loading the file
takes too long if the file is big. Most of the time, I only interested what
the variables are in the the file and the attributes of the variables (like
if it is a data.frame, matrix, what are the colnames/rownames, etc.)
I'm wondering if there is any facility in R to help me avoid loading the
whole file.
2009 Jun 16
1
calling handlers within R_tryEval
Hello,
When using R_tryEval (from JRI in my case), is there a way to setup
error recovery strategy and more generally calling handlers.
From my reading of context.c, R_tryEval calls R_ToplevelExec which
creates a context like this:
begincontext(&thiscontext, CTXT_TOPLEVEL, R_NilValue, R_GlobalEnv,
R_BaseEnv, R_NilValue, R_NilValue);
so I guess what I am trying to do is add
2000 Jan 05
0
Statistical Software Prize
Dear colleagues:
This summer, the ASA will award a new prize for statistical software.
This note is to encourage you to apply or nudge someone you know to
apply.
The award is for software that contributes to better use of computing
in statistical research and applications, written while the applicant
was a student. There is a $1,000 prize plus the opportunity to give
an invited talk at the
2009 Sep 03
1
Running an expression 1MN times using embedded R
Hello,
I'm evaluating this expression
expression({ for(x in 1:5){ .Call('rh_status','x') }})
a million times from a program with R embedded in it. I have attached
reproducible code that crashes with
Program received signal SIGSEGV, Segmentation fault.
0x00002b499ca40a6e in R_gc_internal (size_needed=0) at memory.c:1309
1309 FORWARD_NODE(R_PPStack[i]);
Current language:
2002 Aug 07
0
FW: [R] [ and setMethod conflict?
John Chambers suggested that I forward this thread (first posted to r-help)
along to r-devel...
Thanks,
Kevin
-----Original Message-----
From: John Chambers [mailto:jmc@research.bell-labs.com]
Sent: Tuesday, August 06, 2002 6:31 PM
To: Bartz, Kevin
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] [ and setMethod conflict?
Definitely something funny going on, but perhaps a little less sweeping
2001 Jan 06
0
R/S-Plus compatibility package
We're starting work on an R package and corresponding S-Plus library
to help programmers write software that will work in both systems.
Some descriptions and downloadable software are available on the
Omegahat web site, at
http://www.omegahat.org/SLanguage/
The strategy, as described there, is to be as back-compatible within R
and within S-Plus as possible, but provide tools and guidelines
2001 Nov 02
0
Changes to the methods package
I'm about to commit some changes to the methods package. Before
downloading the revised code, note the following.
Because the changes involve a revised version of storage for the methods
definitions, you will need to re-install any packages that contain
method definitions, from their source code. Otherwise the methods will
look as if they've disappeared from the generic functions.
The
2001 Nov 13
0
Method dispatch in C for primitive functions
There is a version of the methods package committed today that does
dispatch in C for these functions. This should considerably speed up
programs that define methods for these functions (specifically, having
methods should only marginally affect the existing computations for the
same function on basic vectors and objects).
This is the first of several steps needed. Not quite all primitives are
2001 Nov 13
1
Methods package: One of those strategy questions
I had better mention this one separately, since until it's settled you
need a workaround.
If you define methods for primitives now, this does NOT create an
explicit generic function for, say, "[", so that the original primitive
computations still run.
This means that the method dispatch has to be turned on for that
function somehow else.
The proposal is that the library() and
2001 Nov 30
0
New version of methods package
A new version of the package has been committed to the r-devel branch.
There are a lot of changes, mostly non-visible, many of those to tighten
up some possible problems. For example, slot assignment now checks the
validity of the value being assigned, and basic classes cannot be
overriden.
There is a version of the promptClass function by Vince Carey, to
produce shell of documentation for a
2001 Dec 12
0
Changes to methods package in R 1.4
A few recent changes:
- as announced to R-core, the package now has a version of the plot
function with formal arguments (x, y, ...) that allow methods to be
defined for x and/or y. ?setMethod has some examples.
- The "basic classes" have been made somewhat more complete (class
"structure" was added, along with relations among it, "matrix", "array",
2002 Apr 29
0
methods package: inheriting from structures; group generics
Now that 1.5 is released, some changes have been committed to the
r-devel version of the methods package.
They are mostly bug fixes (or making things work more as users would
expect) in two areas:
1. new classes that extend one of the basic datatypes that have
attributes but had no class attribute in S3 (e.g., "matrix" or "ts").
The previous code didn't handle the
2002 Aug 28
0
Fixes/additions to methods package
Some changes committed today to the r-devel (1.6.0) version of the
methods package:
1. The function setOldClass has been added as per the green book, p.
450. The point in this case is not conversion as in the green book so
much as allowing old-style classes to be included in signatures given to
setMethod.
This worked before (with a warning), but old-style inheritance couldn't
be picked up.