Displaying 20 results from an estimated 6000 matches similar to: "S4 class and Package NAMESPACE [NC]"
2010 Feb 06
1
Posting an 'S4-creating Package Problem'...
Hello R-Team,
May you help me to post a 'S4-creating Package Problem'?
Thanks already now for supporting.
The problem sounds like:
Hello R forum,
while compiling my R-package these 'Warnings' occur:
...
Warnung in matchSignature(signature, fdef, where) :
in the method signature for function "plot" no definition for class:
"prediction"
Warnung in
2010 Mar 22
1
Some more help on S4 mechanism
Hello to the list
Some days ago, I placed a question on this maling-list and received an
answer from Martin
that I tried to follow. Unfortunately, I am still puzzled by the next step.
I spent the whole Week-end in gathering information from the net.
Some of them are almost contridtcory and I lack a good document to help me.
So my first question would beL Is there a convenient document which
2008 Apr 07
1
Builind C code for R with cygwin [C1]
Hello,
I would like to build shared lib for R using cygwin environment. After
installing needed tools (mainly perl, make and compilers), I ran
R CMD SHLIB hw.c
But I get the following error :
$ R CMD SHLIB hw.c
c:/PROGRA~1/R/R-26~1.2/src/gnuwin32/MakeDll:82: *** multiple target
patterns. Stop.
Google it didn't give me any hints.
Thanks for your help.
Sylvain Archenault.
2007 Dec 08
2
NAMESPACE choices for exporting S4 methods
We are building a package, and want to create S4 methods for both head and
mean for our own BigMatrix class. Following the recommendation in "Writing
R Extensions" we use exportMethods instead of export in NAMESPACE (this is
described as being "clearer"). This works for head, but not for mean.
Obviously we importFrom(utils, head), but don't need to do this for mean,
2011 Dec 15
1
S4 NAMESPACE method imports and exports do not include (promoted?) generics
In
> R.version.string
[1] "R Under development (unstable) (2011-12-15 r57901)"
section 1.6.6 of 'Writing R Extensions' says
Note that exporting methods on a generic in the namespace will
also export the generic, and exporting a generic in the
namespace will also export its methods.
and
Note that importMethodsFrom will also import any generics defined in
2009 Jan 13
2
particulars of importing/loading libraries
Dear List:
Sorry for posting maybe a trivial question, but I have a basic
understanding problem. If I have say pack1 and pack2, two R packages,
and pack2 depends on and imports pack1 fully (as in the code below), is
there a way to make all the functionality of pack1 available for the
global and other environments (not only for the functions called from
withing pack2) by loading pack2 only? I
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
2010 Aug 18
1
Automatically retrieve correct collation
Dear List,
consider the following scenario:
setClass(Class = "A", representation = representation(B = "B", C = "C"))
setClass(Class = "B", representation = representation(C = "C"))
setClass(Class = "C", representation = representation(something =
"character"))
Obviously, the collation for sourcing these defs needs to be: C,
2009 Aug 17
2
S4 Generics and NAMESPACE : justified warning ?
Dear list,
It seems that a package (pkgB) using another package (pkgA) with S4
generics formed by taking existing functions (for example 'plot') must
not import the existing functions ('plot') in its namespace to avoid
the warning "replacing previous import: plot".
Suppose we use the simple 'import' directive in the name space of
pkgB.
pkgA and pkgB files would
2010 Nov 10
1
S4 package warning
Hello everyone. R-2.12.0, suse linux 11.3.
I am debugging a package that uses S4 methods
and R CMD check gives the following warning:
> Warning in methods::findMethods(g, env) :
> non-generic function 'mdm' given to findMethods()
> See the information on DESCRIPTION files in the chapter 'Creating R
> packages' of the 'Writing R Extensions' manual.
I
2005 Nov 17
2
Building S4-classes, documents
Hello,
I have some troubles when building S4-class packages.
All my (S4-)code works well (without building a package).
When building a package, in the R prompt after
checking S3 generic/method consistency
Following error occurs:
Fehler: Kann R Kode in Packet 'AddNoise' nicht laden (~Error: Can not
load R code from package 'AddNoise')
(and there are some warnings after the
2008 Nov 06
1
problem packaging S4 class that contains a slot of jobjRef class
Hello,
I'm trying to package some source files that link R to a broker using
a Java API and the rJava package. I am successful doing the connection
and operate on it using my R code. I would like to package the files and
release the package.
I created some S4 classes to hold several Java objects. I use WinXP and R
2.7.1. I've searched RSeek and the Wiki for help, but could not find a
2008 Mar 20
1
S4 : package creation
Hi the list,
Using S4, how can we create a package? In "S4 Classes in 15 pages, more
or less", they put all the classes definition in a function that will be
called at the opening of the library and they add "by hand" a Rd file.
Is it the only way ? Is there something like "S4.package.skeleton"?
Thanks
Christophe
2012 Dec 08
1
namespace S3 and S4 generic imports cannot both be satisfied:
PkgA wishes to write a method for 'unique' on S4 class 'A'. ?Methods indicates
that one should
setGeneric("unique")
setClass("A")
unique.A <- function(x, incomparables=FALSE, ...) {}
setMethod(unique, "A", unique.A)
Both S3 and S4 methods need to be exported in the NAMESPACE
import(methods)
S3method(unique, A)
2012 Apr 12
1
R-2.15.0 and Exporting Methods Converted To S4 Generic
Late to the show on this release, unfortunately.
One of our production packages no longer builds under R-2.15.0
with the following message.
** testing if installed package can be loaded
Error: Function found when exporting methods from the namespace
'SuperCurve' which is not S4 generic: 'image'
Possibly relevant clues follow:
## From R/AllGenerics.R
if
2013 Jun 05
1
conflicting imports despite using importFrom in NAMESPACE
Dear all,
It is my understanding that using 'importFrom' in the NAMESPACE of a package allows to avoid conflicts between different packages defining objects with identical names. However, I can still see conflicts while loading the package using 'library'.
Here is a toy example, with a package 'foo' importing 'as.igraph' from the igraph package, and 'nj'
2009 Dec 01
4
Package is loaded but functions are not exported
Hello,
I wrote a package, which in the NAMESPACE file exports functions like this:
exportPattern("^\\rh")
On R-2.8 (Linux, 64), upon loading the package I have the rh functions present.
On R-2.10, Mac OS X, (32 bit), it builds, loads, but the functions are not
loaded, i.e the only function is rhyper (which is not from my package).
Is there something wrong with my package setup?
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
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
2014 Jul 11
1
Namespaces and S4 Generics
I've installed R-devel
R Under development (unstable) (2014-07-09 r66111)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
and am trying to resolve some problems that I am seeing with my
SparseM package. In prior versions I explicitly had:
setGeneric("image", function(x, ...) standardGeneric("image"))
and then used setMethod to define a method for the class matrix.csr
but