similar to: package 'stats' needs import directive for 1.9.0?

Displaying 20 results from an estimated 8000 matches similar to: "package 'stats' needs import directive for 1.9.0?"

2004 Jan 08
3
S3, S4, namespace
I have encountered an issue which I have been unable to resolve, involving an S3 generic (print) being declared S4 generic in a package, and the method being exported. This all works fine - the problem occurs when I try to import the method to another package. Here is the bit that works fine. ------------- #the .r file for package bar
2008 May 20
1
S4 generic for lowess
Hi, A lowess method is defined in our package for one of our S4 classes. To explicitely define the generic this is being used if (!isGeneric("lowess")) setGeneric("lowess", useAsDefault = lowess) This works fine for many other methods inherited from various R packages. In this case a warning is issued in R CMD check: * checking R code for possible problems ... NOTE
2010 Jan 11
1
Problem with S4 generic function print
First, if I have an S4 class boo should I define S3 method for printing print.boo(..) or should I define S4 method print(..). I mainly need to define print function only because some user might call it and then I would like to dispatch the call to right function instead. Second, it seems that by defining S4 generic function print, it is possible to break argument hinting on the status bar.
2006 Oct 19
1
default arguments in generics and methods
i believe the following is true but would appreciate confirmation that it is intended behavior and will continue: if a default argument is employed in the definition of a generic function, and the generic is called with the argument in question (call it 'ARG') missing, then the method for signature (..., ARG = "missing", ...) will be called by 'standardGeneric'
2003 Sep 27
2
does isGeneric work differently in 1.8.0 ?
Hello, the last command (isGeneric) in following R-code (attached) produces different output, depending on wheter 1.8.0 alpha or 1.7.1 is used. Is that to be expected ? Both R Versions were started with option vanilla --------------------------------------------------- R.1.7.1: --------------------------------------------------- > version _ platform i686-pc-linux-gnu arch i686
2007 Mar 15
4
R 2.5.0 devel try issue in conjuntion with S4 method dispatch
Hi, after updating R 2.5.0 devel yesterday we today observed many new unexpected failures in our daily package build and test system runs, which can be traced to recent changes in the implementation in try() (as noted in NEWS). Investigating this new implementation I come across an issue in conjuntion with using S4 classes and methods. try(expr) does not return an object with attribute
2008 Feb 24
2
Generic Functions
Hi I have some problems in defining new generic functions and classes. Just have a look at the following example: require(fPortfolio) setClass("PROBECLASS", representation( type="character" ) ) isGeneric("setType<-") #Returns TRUE #I would like to define a specific function for
2008 Feb 24
2
Generic Functions
Hi I have some problems in defining new generic functions and classes. Just have a look at the following example: require(fPortfolio) setClass("PROBECLASS", representation( type="character" ) ) isGeneric("setType<-") #Returns TRUE #I would like to define a specific function for
2006 Oct 11
1
dispatching on group generics with more than one formal
please see the code below. foo2 fails to dispatch correctly, but foo does fine. i have tried 'cacheMetaData(1)' and a number of different variants of 'cacheGenericsMetaData', on the possibility there is a caching issue. but i still can't sort it out. also one general question: does it really matter what's in the body of the function definition in a
2003 Jul 09
2
Packages, generics, S3 and S4
My question has two parts. The first is with regard to the frame or environment in which generic functions are defined in packages. It seems as though they are defined (i.e. exist as objects) in frame 1, even when defined in a package. The following is a short example: setClass("track",representation(x="numeric",y="numeric")) plotTrack <- function(x,y,...)
2005 Oct 14
1
extending lattice to S4 classes
Hi, I'm writing methods for a package called FLCore (see http://flr-project.org/) in particular for a class called "FLQuant" which extends array. Previously I was able to write methods based on the class of "data" but now I can not do it due to the single parameter "x". Is there a way to do this ? Regards EJ
2005 Dec 29
1
trouble with S4 methods for group "Summary"
Hello. This question concerns the Methods package. I have created a new class and am trying to set a method for it for S4 group generic "Summary". I have run into some signature problems. An example: > setClass("track", representation(x="numeric", y="character")) [1] "track" > setGeneric("max", group="Summary")
2011 Jun 01
1
Overloading S4 methods
Dear all, I am experiencing some problems with S4 method overloading. I have defined a generic for graphics:plot, using setGeneric("plot", useAsDefault = plot) and with importFrom('graphics', 'plot') and exportMethods('plot') in the NAMESPACE file of pkg A. I then proceed to define a method for signature c('myS4class', 'missing'). This works
2006 Feb 14
3
S4 classes and methods with optional arguments
Hi, i have used S4 classes to implement a unified access to random number generators (package rstream on CRAN). I have used a construct to allow optional arguments: if(!isGeneric("rstream.sample")) setGeneric("rstream.sample", function(stream,...) standardGeneric("rstream.sample")) setMethod("rstream.sample",
2009 Nov 04
1
s4 generic issue
I'm hoping that someone with deeper insight into S4 than I, that is to say virtually everyone reading this list, could help resolve the following problem in SparseM. We have setGeneric("backsolve", function(r, x, k = NULL, upper.tri = NULL, transpose = NULL, twice = TRUE, ...) standardGeneric("backsolve"), useAsDefault= function(r, x,
2004 Mar 16
2
Documentation on how to put classes and methods in packages with namespace?
Documentation on how to put classes and methods in packages with namespace? How should I define my classes and methods in "dynamicGraph"??? (That is - Can some one point me to the documentation on how to put classes and methods in packages with a namespace? ) Currently it is done by the code below. This gives problems, when a workspace with a "dynmaicGraph" is
2012 Nov 21
1
S3 generic/method consistency issue with R CMD check
Hi, I'm having some trouble setting methods for the qr family of functions. I believe I have distilled my misunderstanding in the code snippet below: foo <- function(x, ...) UseMethod("foo") foo.default <- function(x) { } # foo setGeneric(name = "foo", useAsDefault = foo) setMethod("foo", signature(x="bar"), function(x, ...) { } )
2006 Mar 17
0
setMethod bug
Hi, I define a generic function that has many parameters (~20). I then want to define methods for the generic function with setMethod. The default behavior for setGeneric is to allow dispatching on any argument in the def function, expect ... For example, # define a generic function setGeneric("test", useAsDefault=FALSE,
2001 Nov 28
1
Assignment to a list in a function
Assignment to a list in a function does not behave as I would expect. The following function illustrates the point #---------------------------------------- temp _ function() { nf _ 2 ns _ 5 z _ vector("list",ns) x _ matrix(NA,nrow=ns,ncol=nf) for(j in 1:ns) { for(i in 1:nf) { x[,i] _ i+j*100 } z[[j]] _ x print(z[[j]]) } z }
2005 Jun 17
1
(PR#7951) DispatchOrEval missing in do_isfinite and do_isinfinite
Hi, OK, if you try to explicitly make them generic, you are told that they are implicitly already generic: > setGeneric("is.finite", function(from, ...) standardGeneric("is.finite")) Error in setGeneric("is.finite", function(from, ...) standardGeneric("is.finite")) : "is.finite" is a primitive function; methods can be defined, but the