similar to: setGeneric for residuals, etc

Displaying 20 results from an estimated 10000 matches similar to: "setGeneric for residuals, etc"

2010 Jun 08
2
Extract/format/show for S4 objects
Hi all, I'm trying to make an integer-backed quarter (as in fraction of year) class, but I can't quite it to work. I want integer-backed so I don't have to worry about floating-point effects when doing math, and so that I can use it as in data.table. First of all, is there a good reference for this anywhere? All of the S4 tutorials that I've found have been too high-level, and
2010 Aug 06
3
memory use without running gc()
Is there any way to get the current memory used by R without running gc()? I'd like to include the memory usage in logging output, but calling gc() to get that information takes long enough to be noticeable (~ 6 s with ~ 20 GB of ram in use), which goes against the point of logging. Thanks, Johann
2004 Dec 03
2
setGeneric(rm)
Hi, We are developing a package using S4 classes. The S4 classes are wrappers to C++ classes. So S4 classes contain an integer that is the memory address of one C++ object. If an user calls the rm() function, the C++ object must be deleted. But our generic rm() function apparently doesn't work. Here is the code: # The class setClass("component",
2010 Feb 08
1
using setMethod or setGeneric to change S4 accessor symbol from @ to $
I created some S4 objects that are essentially data frame objects. The S4 object definitions were necessary to verify data integrity and force a standardized data format. I am, however, finding myself redefining all the typical generic functions so that I can still manipulate my S4 objects as if they were data frames ... I have used setMethod to set methods for "subset",
2010 Sep 23
1
Behavior of R CMD build and library() w.r.t. setGeneric-like functions
Hello developeRs, Apologies in advance for a rather long email, but to describe the problem, I need to step through many details. I have been working on a new dispatching system (futile.paradigm on CRAN) based on functional programming concepts that is an alternative to S3 and S4 dispatching. I use a declarative syntax using guard statements to control the dispatching between function variants. I
2012 Nov 27
1
best HDF5 package: h5r or rhdf5?
What is the current best package for manipulating HDF5 data files? I tried "hdf5" a long time ago, but I ran into memory problems. "h5r" is on CRAN now, and "rhdf5" is part of bioconductor. Ideally, I'd like to read simple vectors or tables, either the entire thing or a subset of rows. I don't need much writing support, but it would be nice. Compression is a
2018 Apr 19
2
odd assignInNamespace / setGeneric interaction
>>>>> Michael Lawrence <lawrence.michael at gene.com> >>>>> on Wed, 18 Apr 2018 14:16:37 -0700 writes: > Hi Bill, > Ideally, your coworker would just make an alias (or shortcut or > whatever) for R that passed --no-save to R. I'll try to look into this > though. > Michael Yes, indeed! As some of you know, I've
2008 Mar 13
3
Sealed for setGeneric
Hi the list When two setGeneric occurs on the same function, the second erage the first and erase all the function previously define. Is it possible to prevent that ? Is it possible to declare a setGeneric that can not be erased later ? Something like the |sealed for setMethod...| || |Thanks| || Christophe
2013 Feb 02
1
setGeneric() gives "must supply skeleton" when checking package
r-devel, In a development version of the CRAN package metrumrg, I write ... require(reshape) setGeneric('cast') setOldClass(c('keyed','data.frame')) setMethod('cast','keyed', function ...) The result is satisfactory when sourcing the code directly, but when checking the package (which has 'reshape' as a dependency in the DESCRIPTION file) I get
2010 Jan 19
1
calling setGeneric() twice
Is it safe to call setGeneric twice, assuming some setMethod's for the target function occur in between? By "safe" I mean that all the setMethod's remain in effect, and the 2nd call is, effectively, a no-op. ?setGeneric says nothing explicit about this behavior that I can see. It does say that if there is an existing implicity generic function it will be (re?)used. I also tried
2002 Jan 06
1
How to get setGeneric() to work?
Dear all, I can't see how setGeneric() works. I know perfectly well how to define library(methods); setClass("Square", representation(side="numeric")); # Will become the default method. getArea <- function(object) { stop(paste("Method getArea() is not defined for this class:", data.class(object))); } setMethod("getArea",
2009 Nov 09
1
zoo: bug with unique for yearmon
I'm using R 2.10.0, with zoo 1.5-8. The release notes for zoo 1.5-8 claim a bug with unique for yearmon objects has been fixed, but I'm still having problems. Browse[1]> tmp2 [1] "Dec 1996" "Dec 1996" Browse[1]> unique(tmp2) [1] "Dec 1996" "Dec 1996" Browse[1]> unique(unique(tmp2)) [1] "Dec 1996" Browse[1]> as.numeric(tmp2) -
2003 May 27
1
setGeneric?
In the last few days I've received couple of messages pointing out that our SparseM package fails to install on the patched version of 1.7.0. Laurent Gaultier kindly suggested that replacing: setGeneric("as.matrix.csr") by setGeneric("as.matrix.csr", function(x, nrow, ncol, eps) standardGeneric("as.matrix.csr")) was sufficient to fix the problem.
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 Aug 24
1
setMethods/setGeneric problem when R CMD CHECK'ing a package
R-helpers: I'm trying to build a package, but I'm a bit new to the whole S3/S4 methods concept. I'm trying to add a new definition of the zoo function "as.yearmon", but I'm getting the following error when it gets to this point during a package install: *** R CMD INSTALL STARStools * installing to library
2013 Feb 14
4
2 setGeneric's, same name, different method signatures
hi. below is a small test case (hopefully minimal, though i'm still a bit confused about initializers). i would have guessed (and maybe i still would have been right) that one could re-use the name of a generic function for functions with different numbers of arguments. in the case below, class A's bB() queries the status of a single A object, so bB(A) (where here "A" is an
2006 Oct 18
2
Multiple histograms in one plot
Hi all, I'm trying to plot multiple histograms in one plot (cross-validation values of model parameters), but I cannot seem to reduce the margins enough to fit as many of them in as I would like. I'm using split.screen to divide the window into a 5x4 grid, then plotting with hist. I've tried explicitly reducing the margins with par(mar=c(1,1,1,1)), but it doesn't seem to have
2002 Sep 10
1
setGeneric(); R CMD check
1. Is it always the case that when defining generic functions in a package, the package needs to be installed as a binary package to avoid having the generic functions in the .GlobalEnv? 2. Defining a generic function in a "non-binary" package triggers a check warning $ R CMD check ... ... * checking for code/documentation mismatches ... WARNING Objects
2007 Mar 22
2
dynamic linear models in R
Hi all, I've just started working my way through Mike West and Jeff Harrison's _Bayesian Forecasting and Dynamic Models_, and I was wondering if there were any publically-available packages to handle dynamic linear models, as they describe. I found the "dynlm" package, but either I don't yet understand what's going on or that package uses a different sense of the phrase
2018 Apr 18
2
odd assignInNamespace / setGeneric interaction
A coworker got tired of having to type 'yes' or 'no' after quitting R: he never wanted to save the R workspace when quitting. So he added assignInNamespace lines to his .Rprofile file to replace base::q with one that, by default, called the original with save="no".. utils::assignInNamespace(".qOrig", base::q, "base")