Displaying 20 results from an estimated 3000 matches similar to: "class export in package creation / setClass / namespace?"
2009 Jul 20
1
R package creation: 'show' extension not imported correctly
Dear List,
I have a problem related to R package creation.
I extended the 'show' method to cover a new class
with the following lines in the zzz.R file in the R directory while creating
an R package.
>setClass("rpa", contains="list")
>show.rpa <- function (...) {cat("rpa object \n")}
The corresponding lines were also added to NAMESPACE file:
2009 May 18
1
S4 method dispatch and namespaces: why is default method selected
Hi,
I ran into the following peculiarity involving S4 method dispatch and
namespaces.
I develop a package which have a namespace and which depends on 'pixmap'
package, which itself does not have a namespace.
Now, in my package I have a class which has a slot for objects from
class "pixmap" and I
want to have a "plot" method for this new class. Not to clutter the
2007 Jun 04
2
locked environment and inheritance
Hi,
I have a S3 package with namespace called "myS3Pkg". Inside my package I would like to create
a S4 class which extends (adds 2 slots) another S4 class from some other package. The class
should be created in "myPkg" environment (and not global environment).
Using:
setClass("myS4class", representation("otherS4class", mydata = "numeric"),
2019 Mar 23
4
topenv of emptyenv
I was surprised just now to find out that `topenv(emptyenv())` equals
? `.GlobalEnv`, not `emptyenv()`. From my understanding of the
description of `topenv`, it should walk up the chain of enclosing
environments (as if by calling `e = parent.env(e)` repeatedly; in
fact, that is almost exactly its implementation in envir.c) until it
hits a top level. However, `emptyenv()` has no enclosing
2013 May 08
1
Namespace/inheritance problem in S4 methods for a union class
Hi,
I started this post on bioc-devel but this seems to be more general:
https://stat.ethz.ch/pipermail/bioc-devel/2013-May/004311.html
See reproducible example from Martin below.
Thank you.
Renaud
---------- Forwarded message ----------
From: Martin Morgan <mtmorgan at fhcrc.org>
Date: 7 May 2013 19:55
Subject: Re: [Bioc-devel] ExpressionSet and LumiBatch: inheritance problem
in S4
2012 Feb 26
1
improved error message when existing implicit S4 generic is not imported?
pkgA's NAMESPACE has
importFrom(graphics, plot)
exportClasses("A")
exportMethods("plot")
R/foo.R has
setClass("A")
setMethod("plot", "A", function(x, y, ...) {})
During R CMD INSTALL pkgA_1.0.tar.gz we are told
** preparing package for lazy loading
Creating a generic function for 'plot' from package
2005 Aug 05
1
S4 setClass with prototypes " issues" (PR#8053)
To R-Developers:
I wish to report what I believe are inconsistencies between Green Book
descriptions and R methods behaviors. I **realize** that R does not
guarantee total consistency with the Green Book; therefore I leave it to you
to decide whether any of this is a bug, design choice, or a need for
additional documentation -- or whether I have simply misread or overlooked
existing explanations.
2010 May 29
3
S4 dispatch for .DollarNames (utils)
Hello,
I'm trying to make .DollarNames generic and implement a method for it in
a package. .DollarNames is the function that is now called to get
completion possibilities.
My R code looks like this:
setGeneric( ".DollarNames" )
setClass("track",
representation(x="numeric", y="numeric"))
## A class extending the previous, adding one more
2006 Jan 08
2
exporting methods/classes
Dear R People:
I'm still struggling with sending methods and classes as part of
creating a new package.
Where does the .onLoad function go? Within R itself or in a file
in one of the new package directories?
Here are my latest efforts:
Here's the last part of the woof1-Ex.Rout
> library('woof1')
Error in loadNamespace(package, c(which.lib.loc, lib.loc),
keep.source =
2015 May 10
2
S4 method dispatch sometimes leads to incorrect when object loaded from file?
Loading an S4 object from a file without first loading the library sometimes (?,
the example below and actual example involves a virtual base class and the show
generic) leads to incorrect dispatch (to the base class method).
The attached package reproduces the problem. It has
setClass("A")
setClass("B", contains="A")
setMethod("show", "A",
2003 Sep 02
1
completeSubclasses() methods bug (PR#4051)
Full_Name: Colin A. Smith
Version: 1.8.0
OS: Mac OS X 10.2.6
Submission from: (NULL) (128.102.184.81)
annaffy 1.0.1 (in BioC CVS) fails to load. annaffy 1.0 (on the BioC web site)
has the same problem.
It looks like the load is failing because of a bug in completeSubclasses() in
r-devel. It calls setIs() and doesn't specify an environment via the "where"
argument. setIs()
2007 Apr 19
2
setClass inside a function
Hello,
I would like to create a function that gets passed a class name and then calls setClass, and a few other functions, inside. I have done this in the past with setmethod, creating accessors for all slots in a set of S4 classes. But setClass is choking when my function is called isnide a package, telling about an error in exists(cname, where). I assume this to be a problem with the
2005 Dec 08
1
Loading namespaces
I'm creating a package for my own use that uses some S4 classes but no
methods.
I have a file called NAMESPACE it contains the line:
exportClasses("foo")
and at the top of the R file I have
setClass("foo", representation(x="numeric")
and the line:
.onLoad<-function(libname,pkgname)
When I run R CMD check I get Syntax error in the only R file. If I
2011 Dec 15
1
R CMD check fails to warn about undocumented classes and methods
In
> R.version.string
[1] "R Under development (unstable) (2011-12-15 r57901)"
PkgA promotes 'unique' to a generic and exports that
DESCRIPTION:
Imports: methods
R/f.R:
setGeneric("unique")
NAMESPACE:
export(unique)
and PkgB creates and exports a method on unique
DESCRIPTION
Imports: methods, PkgA
R/f.R:
setClass("B",
2004 Oct 14
2
setClassUnion
Hello,
I have a question concerning "setClassUnion".
I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000.
I tried to use "setClassUnion" in a package I am currently working on. The
situation is similar to the following example:
The DESCRIPTION file has entries:
Depends: R (>= 2.0.0), methods
Imports: methods
LazyLoad: yes
The NAMESPACE file has
2004 Oct 14
2
setClassUnion
Hello,
I have a question concerning "setClassUnion".
I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000.
I tried to use "setClassUnion" in a package I am currently working on. The
situation is similar to the following example:
The DESCRIPTION file has entries:
Depends: R (>= 2.0.0), methods
Imports: methods
LazyLoad: yes
The NAMESPACE file has
2019 May 22
1
print.<strorageMode>() not called when autoprinting
Hi Martin,
> On 22 May 2019, at 03:50, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>
> I'm pretty sure that all teaching and documentation about S and R
> has suggested that print(f) and auto-printing should result in
> the same output _ AFAIR also for S4 objects
I agree with the principle that autoprint and print() should be
equivalent for users. However
2004 Jun 18
0
Problem with setValidity() or resetClass() or ... ?
Hi,
I'm working with Version 1.9.0 (2004-04-12) on Windows 98/NT/2000 where
I found the following wrong (?) behavior of setValidity().
I already mentioned this on the R-help list (2004-06-11, was
"setValidity changes Extends?") , but as I got no answer I tried to
figure out what's happening.
Well, setValidity() behaves not as I would expect (something about the
2008 Dec 24
1
SSL cert problems.
I'm really racking my brain trying to figure this one out here. I am
running a pop3 server for remote offices on CentOS 5.2. We purchased a
SSL cert from Verisign and installed it on our dovecot server, but I
continue to get failure problems with the cert and I don't know where to
go from here.
here is some info about our config:
dovecot version:
# dovecot --version
1.0.7
hostname:
2009 Jun 09
2
Isolating a single plot from plots produced simultaneously
Dear R-Help,
I am using the 'mfp' package. It produces three plots (as I am using
the Cox model) simultaneously which can be viewed together using the
following code:
fit <- mfp(Surv(rem.Remtime,rem.Rcens)~fp(age)+strata(rpa),family=cox,data=nearma,select=0.05,verbose=TRUE)
par(mfrow=c(2,2))
plot(fit)
They can be viewed separately but the return key must be pressed after
each graph