search for: pkga

Displaying 20 results from an estimated 51 matches for "pkga".

Did you mean: pkg
2016 Feb 10
0
Method from package dependency is not updated due to lazy load?
Hi, not sure this is a bug or just an unavoidable undesirable side-effect -- or just me that does not do the right thing. Consider the code and output below. It creates 2 packages: * pkgA * pkgB that creates a method for a generic defined in pkgA Changes in a method for the generic in pkgA (after re-installing pkgA) are not reflected in pkgB, unless pkgB is re-installed against the new version of pkgA. I understand this may be linked to lazy-loading, which somehow keeps the old m...
2014 Oct 31
2
Options that are local to the package that sets them
Dear All, I am trying to do the following, and could use some hints. Suppose I have a package called pkgA. pkgA exposes an API that includes setting some options, e.g. pkgA works with color palettes, and the user of the package can define new palettes. pkgA provides an API to manipulate these palettes, including defining them. pkgA is intended to be used in other packages, e.g. in pkgB1 and pkgB2. Now...
2013 Aug 30
2
"False" warning on "replacing previous import" when re-exporting identical object
Hi, SETUP: Consider three packages PkgA, PkgB and PkgC. PkgA defines a generic function foo() and exports it; export(foo) PkgB imports PkgA::foo() and re-exports it; importFrom(PkgA, foo) export(foo) PkgC imports everything from PkgA and PkgB: imports(PkgA, PkgB) PROBLEM: Loading or attaching the namespace of PkgC will generate a...
2015 Jul 03
1
Are downstream dependencies rebuilt when a package is updated on CRAN?
I was wondering: are the downstream dependencies of a package rebuilt when a package is updated on CRAN? (I'm referring to the binary packages, of course.) The reason I ask is because there are cases where this can cause problems. Suppose that when pkgB is built, it calls pkgA::makeClosure(), which returns a closure that refers to a function in pkgA. Suppose this code is in pkgA 1.0: makeClosure <- function() { function() { funA() } } funA <- function() "funA was called!" And this is the code in pkgB: foo <- pkgA::makeClosure() After buildi...
2015 May 10
2
S4 method dispatch sometimes leads to incorrect when object loaded from file?
...unction(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 "library(PkgA); load(file='b.Rda'); b" B but loading the object without first loading PkgA leads to dispatch to sho...
2015 May 12
1
S4 method dispatch sometimes leads to incorrect when object loaded from file?
...succeed to load the package (yes "package" ! ;-)) when 'needed', right, so show() is an exception here, no ? >> The attached package reproduces the problem. It has > The package was attached but stripped; a version is at > https://github.com/mtmorgan/PkgA > FWIW the sent mail was a multi-part MIME with the header on the package part > Content-Type: application/gzip; > name="PkgA.tar.gz" > Content-Transfer-Encoding: base64 > Content-Disposition: attachment; > filename="PkgA.tar.gz"...
2010 Sep 07
0
Sexpr in package.Rd fails
If I f = function() {} package.skeleton("PkgA", "f", path="/tmp") and then edit man/PkgA-pacakge.Rd to read in part \description{ More about what it does (maybe more than one line) \Sexpr{1} } and then R CMD build PkgA I end up with Saving output to ?/tmp/PkgA/build/PkgA.pdf? ... Warning in file.create(to[okay])...
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 pk...
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 packag...
2014 Feb 21
0
instantiating a reference class with an initialize() method from .onLoad fails
PkgA has a single R/binding.R file containing .A <- setRefClass("A", methods=list(initialize=function(...) {})) .onLoad <- function(...) .A() A NAMESPACE with import(methods) exportClasses("A") and DESCRIPTION Package: PkgA Type: Package Ti...
2015 May 11
0
S4 method dispatch sometimes leads to incorrect when object loaded from file?
...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 The package was attached but stripped; a version is at https://github.com/mtmorgan/PkgA FWIW the sent mail was a multi-part MIME with the header on the package part Content-Type: application/gzip; name="PkgA.tar.gz" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="PkgA.tar.gz" From http://www.r-project.org/mail.html#instructions...
2012 Nov 30
1
Workarounds to Rd file name conflict when extending a S4 method of some other package
...retty much ended up using S4 functionality in everything I do 3) I'm a big fan of "in-file documentation" and package 'roxygen2' does a wonderful job in helping me out keeping my Rd help files synced That being said, it is a quite common scenario that some package (say 'pkga') contains the *generic* method/function 'foo()' as well as *some* custom methods (for different data types of the available signature arguments). Now, let's suppose that someone using 'pkga' and building a new package (say 'pkgb') would like to build upon the ge...
2011 Dec 15
1
S4 NAMESPACE method imports and exports do not include (promoted?) generics
...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 the namespace on those methods However, if 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",...
2013 May 08
1
Namespace/inheritance problem in S4 methods for a union class
...t; Date: 7 May 2013 19:55 Subject: Re: [Bioc-devel] ExpressionSet and LumiBatch: inheritance problem in S4 methods 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(&qu...
2011 Oct 15
2
.onLoad failing because could not find function "loadMethod"
...ing whether the package can be unloaded cleanly ... WARNING <same error here> * checking whether the namespace can be loaded with stated dependencies ... WARNING <same error here> It seems to happen when pkgB has code in its .onLoad hook that tries to call a method defined in pkgA (pkgB imports pkgA) on an object 'x' that is an instance of a class defined in pkgA. For some obscure reason it seems that, at the time the .onLoad hook is executed, the methods package (which is imported in both packages) is not working properly. I've put 2 toy packages here that illu...
2014 Nov 15
1
Code tools for identifying which package A functions package B use?
Hi, I'd like to list all package PkgA functions that another package PkgB use via Depends or Imports (ignoring Suggests for simplicity). As long as PkgB uses importFrom("PkgA", ...) it's just a matter of parsing the NAMESPACE file or inspecting asNamespace("PkgB")$.__NAMESPACE__.$imports. However, what can be...
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",...
2013 Mar 13
1
S4 generic not exported correctly / incorrect dispatch?
In this post https://stat.ethz.ch/pipermail/bioc-devel/2013-March/004152.html a package author reports that S4 dispatch fails. I can reproduce this with a PkgA (attached; 'intervals' is a relatively light-weight CRAN package) that has DESCRIPTION with Depends: intervals Imports: graphics NAMESPACE: importFrom(graphics, "plot") export("plot") exportMethods("plot") R/tmp.R setClass("A") setMethod("p...
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...
2019 Oct 30
2
set.seed() in a package
...first one backing it up. On a related note; there are packages that forward the .Random.seed when loaded. This is also an unfortunate behavior because you will give different RNGs depending on that package was already loaded before you called a function that depends on it or not. For example, if pkgA forwards the .Random.seed when loaded, the following is *not* reproducible: # User might or might not have loaded pkgA already if (runif(1) < 0.5) loadNamespace(pkgA) set.seed(0xBEEF) loadNamespace(pkgA) y <- runif(1) I ran into this problem when doing some strict testing. I argue this al...