GithubHelp home page GithubHelp logo

Comments (7)

joey711 avatar joey711 commented on July 24, 2024

R CMD check phyloseq

  • checking whether package ‘phyloseq’ can be installed ... WARNING
    Found the following significant warnings:
    Warning: replacing previous import ‘plot’ when loading ‘phylobase’
    Warning: replacing previous import ‘summary’ when loading ‘phylobase’
    See ‘/Users/pjm2/github_packages/phyloseq.Rcheck/00install.out’ for details.

from phyloseq.

joey711 avatar joey711 commented on July 24, 2024

Here are some links related to this issue:

http://r.789695.n4.nabble.com/S4-Generics-and-NAMESPACE-justified-warning-td925030.html

http://r.789695.n4.nabble.com/multiple-defines-of-diag-td3877953.html

More general links about namespace:

http://www.stat.uiowa.edu/~luke/R/namespaces/morenames.html

http://stackoverflow.com/questions/4371181/namespaces-in-r-packages

https://stat.ethz.ch/pipermail/r-devel/2011-August/061744.html

https://github.com/hadley/devtools/wiki/namespaces

from phyloseq.

joey711 avatar joey711 commented on July 24, 2024

It appears that phylobase trivially defines plot() and summary() as S4 generics, then extends them. It works fine for their package, and may also for phyloseq, except that there is a warning during package-build that

 Warning: replacing previous import ‘plot’ when loading ‘phylobase’ 
 Warning: replacing previous import ‘summary’ when loading ‘phylobase’ 

It may be that this is fine on its own, but it is colliding with one of the other package dependencies. ggplot2 is a good suspect, as it has no namespace, but might very well fiddle with plot and summary. Well, except it isn't heavy on S4 methods... Hmm. well, in any case, an obvious fix is to modify the way that phylobase is imported, such that everything but the offending generics "summary" and "plot" are imported.

The plan: Modify phyloseq to be explicit in phylobase import, using importFrom, etc.

(0) Update your own plot-method.r code so that it does not depend on the phylobase plot generic, but rather defines its own.

(1) (Static) Parse the phylobase namespace file, and create a list of functions, methods, and classes that are imported.

(2) (Static) Make a dummy roxygen header that lists all of the import tags necessary to fully import phylobase, less the "plot" and "summery" generics.

(3) (Dynamic) Every time you re-compile the documentation with roxygen, the specific-import commands for phylobase should be re-added to the namespace as if it was just a generic import (less the two problem-causing generics).

Robust?
This should be partially robust to changes by phylobase, because you are only depending on things that exist in the exported space of the package now. In the future, you will need to check that new phyloseq functionality does not depend on new phylobase functionality that was not available during Step 1. If so, Step 1 can be re-run, or the new stuff can be added manually, depending on complexity.

from phyloseq.

joey711 avatar joey711 commented on July 24, 2024

As a preliminary test, phylobase will be listed as a dependency for testpkg, to see if it causes the same error. If so, the fix can be applied to testpkg, to see if that also fixes the problem...

from phyloseq.

joey711 avatar joey711 commented on July 24, 2024

This preliminary test did not cause any warnings. Having phylobase as an imported package does not cause a warning ALONE. I infer that the phyloseq warning is coming from a collision between two different package dependencies defining "summary" and "plot" as objects S4 generics.

Not sure off the top of my head which package it is. Among the imported packages, the new (ver 2.0) package is a prime suspect. However, the proposed solution remains the same.

from phyloseq.

joey711 avatar joey711 commented on July 24, 2024

HOLD THE PHONE!

I apologize to all those other CRAN packages I disparaged with my suspicion. The conflict is actually between phylobase and the Bioconductor package "multtest".

Since I only need 2 functions from multtest, and NONE of its plot or summary related methods, I should be able to do a specific import of the 2 things I need from multtest, in the hopes that that alleviates the conflict.

Testing this hypothesis on testpkg is about to commence...

from phyloseq.

joey711 avatar joey711 commented on July 24, 2024

This worked. A specific import of just the mt.maxT() and mt.minP() functions resolves the conflict on both testpkg and phyloseq. The phyloseq package now passes R CMD check phyloseq without Warnings.

This issue is closed until further conflicts arrise between depended packages.

from phyloseq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.