search for: exportclasses

Displaying 20 results from an estimated 57 matches for "exportclasses".

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
2013 May 08
1
Namespace/inheritance problem in S4 methods for a union class
...ds for union class To: Renaud Gaujoux <renaud at mancala.cbio.uct.ac.za> Cc: bioc-devel at r-project.org, dupan.mail at gmail.com I can replicate this with a simpler example, where PkgA has setClass("A", representation(x="numeric")) with NAMESPACE import(methods) exportClasses("A") PkgB has setClass("B", contains="A") NAMESPACE import(methods) importClassesFrom("PkgA", "A") exportClasses("B") and then library(PkgA); library(PkgB) setClassUnion("C", c("matrix", "A")...
2003 Sep 05
1
namespaces and S4 methods/classes
...it should be back compatible, and it passes the checks (on linux). But approach with caution, namespaces do change the language semantics, and we will likely encounter some surprises. The new directives, in addition to those described in Luke Tierney's article in the June, 2003 R News, are: exportClasses(...) exportMethods(...) importClassesFrom(package, ...) importMethodsFrom(package, ...) The `...' arguments are the names of classes or of generic functions as appropriate. The exportClasses and exportMethods directives export the corresponding class definitions and all the methods for the f...
2009 Jul 09
1
class export in package creation / setClass / namespace?
...t;setClass("rpa", contains = "list", where=topenv(parent.frame())) Use package skeleton to create directory structure: >package.skeleton(name = "test",list=c("tmp")) Edit man files, add test/NAMESPACE file with the following contents: >export(tmp) >exportClasses("rpa") Use R CMD check and R CMD build to create tarball. -> No error messages. Start R, install the created package: >install.packages("test_1.0.tar.gz",repos=NULL) Test the new package: >require(test) >my.object = new("rpa") This gives the error messa...
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' fr...
2010 May 29
3
S4 dispatch for .DollarNames (utils)
...ntains = "track") setMethod( ".DollarNames", signature( x = "track", pattern = "character" ), function(x, pattern){ grep( pattern, c("foo", "bar"), value = TRUE ) } ) and the NAMESPACE : import( utils ) exportMethods( .DollarNames ) exportClasses( track, trackCurve ) When I load the package, I can call .DollarNames explicitely : > require( foo ) > x <- new( "trackCurve", x = 1:10, y = 1:10, smooth = 1:10 ) > .DollarNames( x, "f" ) [1] "foo" but completion does not work : > x$f<TAB>...
2006 Jan 08
2
exporting methods/classes
...library('woof1') Error in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) : in 'woof1' classes for export not defined: dog Error: package/namespace load failed for 'woof1' Execution halted Here's the NAMESPACE importFrom(graphics,plot) exportClasses("dog") exportMethods("plot","show") thanks yet again, Sincerely, Erin mailto: hodgess at gator.uhd.edu
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 ver...
2015 May 10
2
S4 method dispatch sometimes leads to incorrect when object loaded from file?
...eproduces the problem. It has setClass("A") setClass("B", contains="A") setMethod("show", "A", function(object) cat("A\n")) setMethod("show", "B", function(object) cat("B\n")) with NAMESPACE import(methods) exportClasses(A, B) exportMethods(show) This creates the object and illustrated expected behavior ~/tmp$ R --vanilla --slave -e "library(PkgA); b = new('B'); save(b, file='b.Rda'); b" B Loading PkgA before the object leads to correct dispatch ~/tmp$ R --vanilla --slave -e...
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 comment out the .onLoad function I get a package/namespac...
2012 Apr 12
1
R-2.15.0 and Exporting Methods Converted To S4 Generic
...such... ## From various other R files... setMethod("image", signature(x="RPPA"), ... setMethod("image", signature(x="RPPADesign"), ... And then exported them for use outside the package. ## NAMESPACE import(methods) importFrom("graphics", image) exportClasses(....) exportMethods(image) If the problem is because of the exportMethods(), I'm left stumped as to how to work around this. Making our S4 objects useable externally was kind of the point. Source package available, if needed. oompa <- "http://bioinformatics.mdanderson.org/OOMPA/2.1...
2010 Feb 06
1
Posting an 'S4-creating Package Problem'...
...atchSignature(signature, fdef, where) : in the method signature for function "plot" no definition for class: "validation" ** help *** installing help indices ... Maybe my NAMESPACE file looks wrong. Has anybody an idea how it has to look like to solve this problem? ( I use exportClasses(...), exportMethods(...). ) I have 3 classes: 'prediction', 'validation', 'nvalidation' which have a plot function. There's no warning for class 'nvalidation' but for the other two. Any suggestions? Greetings. Dan
2011 Dec 15
1
R CMD check fails to warn about undocumented classes and methods
...and exports a method on unique DESCRIPTION Imports: methods, PkgA R/f.R: setClass("B", representation(b="numeric")) setMethod(unique, "B", function(x, incomparables=FALSE, ...) unique(x at b)) NAMESPACE: importFrom(PkgA, unique) exportClasses(B) exportMethods(unique) There is a man/ page for each package, but no other documentation. Yet R CMD check PkgA_1.0.tar.gz says * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK and for Pkg B we only get * checking for missing docu...
2010 Nov 27
1
Bug in parseNamespaceFile or switch( , ... ) ?
...t;NAMESPACE") [1] "blah( nada )" "blee( nil )" "export( outDS )" > parseNamespaceFile("",".") # now parse it $imports list() $exports [1] "outDS" $exportPatterns character(0) $importClasses list() $importMethods list() $exportClasses character(0) $exportMethods character(0) $exportClassPatterns character(0) $dynlibs character(0) $nativeRoutines list() $S3methods [,1] [,2] [,3] > So, it picked up 'export' and ignored the other two lines. Chuck p.s. > sessionInfo() R version 2.12.0 (2010-10-15) Plat...
2009 Jul 20
1
R package creation: 'show' extension not imported correctly
...g 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: >importMethodsFrom(methods,show) >exportClasses(rpa) >S3method(show,rpa) The CMD check and CMD build do not produce warning messages related to this issue (only warnings are about missing .Rd files). After installing the package ('test' is the package name) I start R and require the new package: > require(test) Loading required...
2007 May 03
1
Imports/exports of S4 methods
...kage 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") exportClasses("bar") in its NAMESPACE file. Should Package B also have Package A in the 'Depends:' field of the DESCRIPTION file or is it correct to import Package A only? Finally, Package C has a single exported function named 'myfunc' which needs to use the method for 'foo...
2005 Apr 28
1
strange behaviour of importFrom directive in name space
...tFrom("KernSmooth", "bkde2D") importFrom("RColorBrewer", "brewer.pal") importFrom("utils", "getFromNamespace", "assignInNamespace") importFrom("MASS", "cov.rob") S3method("$", "cytoFrame") exportClasses("cytoFrame", "cytoSet") exportMethods("colnames", "colnames<-", "description", "description<-", "exprs", "exprs<-", "length", "[", "[[", &...
2005 Apr 28
1
strange behaviour of importFrom directive in name space
...tFrom("KernSmooth", "bkde2D") importFrom("RColorBrewer", "brewer.pal") importFrom("utils", "getFromNamespace", "assignInNamespace") importFrom("MASS", "cov.rob") S3method("$", "cytoFrame") exportClasses("cytoFrame", "cytoSet") exportMethods("colnames", "colnames<-", "description", "description<-", "exprs", "exprs<-", "length", "[", "[[", &...
2007 Dec 10
1
cyclic dependency error
...lid' Execution halted ERROR: lazy loading failed for package 'clValid' ** Removing '/Users/guybrock/Documents/projects/DattaPackages/Cluster/clValid_0.5-4.Rcheck/clValid' The NAMESPACE file is below, .onLoad <- function(lib, pkg) require(methods) importFrom(graphics, plot) exportClasses(clValid) exportMethods(clusters, clusterMethods, nClusters, measNames, measures, optimalScores, plot, print, show, summary) S3method(print,sota) S3method(plot,sota) export(clValid, sota, dunn, connectivity, BHI, BSI, stability, matchGO) My question is - how can I locate the source of the cyclic de...