Displaying 20 results from an estimated 2000 matches similar to: "Questions and suggestions about namespaces"
2003 Dec 05
1
rcmd check question.
Hi!
Can anyone tell what may causes the following errors?
They printed during a
>rcmd check packagename
* checking S3 generic/method consistency ... WARNING
Error in .tryQuietly({ : Error in file(file, "r") : unable to open connection
Execution halted
* checking for replacement functions with final arg not named 'value' ... WARNIN
G
Error in .tryQuietly({ : Error in
2019 Sep 06
1
Cryptic error message from namespaceExport
Dear Michael,
my package has setOldClass("inla") and the NAMESPACE
contains exportClasses(inla) and importFrom(INLA, inla.posterior.sample)
the old version of INLA uses the S3 class "inla" but does not export it.
the new version of INLA has setOldClass("inla") and the NAMESPACE
contains exportClasses(inla)
installing my package in combination with an older INLA
2003 Jun 13
1
Problem with Rcmd check and S4 methods
In the little orientation data package I'm working on, the very first
example fails, even though the same code works when used in a regular
session. In my experience, this usually indicates T or F has been
used instead of TRUE or FALSE, but that's not the case this time.
The error message is
> x <- eulerzyx(1,0,0)
Error: Trying to get slot "validity" from an object of
2019 Sep 06
2
Cryptic error message from namespaceExport
Dear all,
Today I got this error message (R 3.6.1) when installing my package:
Error: package or namespace load failed for ?inlatools? in
namespaceExport(ns, exports):
undefined exports: .__C__inla
My package was using setOldClass("inla") and exported the "inla" class via
the NAMESPACE. It imports functions from the INLA package. Older versions
of the INLA package did not
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
2007 May 01
1
Questions about name space directives
Hi,
I'm hoping to get some clarification of the intent of some of
directives used in NAMESPACE files.
1. Is import(somePkg) also intended to import all classes and methods
that are exported via exportClasses and exportMethods in somePkg?
I think import pulls in classes and methods, but it isn't clear
from the docs whether this is as intended.
2. What is exportMethods intended
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
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 =
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
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
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",
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
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
2007 May 03
1
Imports/exports of S4 methods
I have a question about what to do in the following situation (please bear with
the setup):
Package A defines an S4 generic 'foo' and as well as S4 methods for 'foo' and has
exportMethods("foo")
in its NAMESPACE file.
Package B defines another method for 'foo' for class "bar" and has
importFrom(A, "foo")
exportMethods("foo")
2003 Jul 07
1
Bug in Rd2dvi.sh (or doc error)? (PR#3422)
In 1.7.1 and today's r-patched in Windows, starting a continuation
line with a tab in a DESCRIPTION file causes the continuation to be
lost. For example, I have this file:
Package: orientlib
Title: Support for orientation data
Version: 0.2
Author: Duncan Murdoch
Description: Representations, conversions and display of orientation
SO(3) data.
See the orientlib help topic for details.
2006 Nov 03
1
Formal methods are not loaded from NAMESPACE in reloadedworkspace image
Dear R-Devel subscriber,
as a follow up to my yesterday's email: I tested an analogous example
with the S4-package "flexclust" by executing the following code:
library(flexclust)
example(cclust)
cl
After saving the work space and starting a new R process with the
restored work space, the same behaviour (i.e., the methods pertinent to
"flexclust" are not used, even after
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
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",
2010 Nov 27
1
Bug in parseNamespaceFile or switch( , ... ) ?
parseNamespaceFile() doesn't seem to detect misspelled directives. Looking
at its code I see
switch(as.character(e[[1L]]),
<lots of args omitted here>,
stop(gettextf("unknown namespace directive: %s",
deparse(e)), call. = FALSE, domain = NA))
but this doesn't seem to function as I expect, viz. to stop with an error
if I type a wrong directive.
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