I'm a maintainer of a CRAN package and get the following messages when loading:
* checking whether package ‘qdap’ can be installed ... [10s/10s] WARNING
Found the following significant warnings:
Warning: replacing previous import ‘annotate’ when loading ‘NLP’
Warning: replacing previous import ‘rescale’ when loading ‘scales’
Because I use the plotrix and scales packages as well as the NLP and ggplot packages. They have the functions rescale
and annotate
in common. This results in a significant warning with the latest CRAN check. So I decide to "fix" it.
I made the description something like this:
Package: qdap
Type: Package
Title: Bridging the gap between qualitative data and quantitative analysis
Version: 1.0.0
Date: 2013-06-26
Author: Tyler Rinker
Maintainer: Tyler Rinker <[email protected]>
Depends:
R (>= 3.0.0),
ggplot2 (>= 0.9.3.1),
gdata,
grid,
Imports:
NLP,
openNLP,
plotrix,
scales,
LazyData: TRUE
Description: Stuff
License: GPL-2
And added this to some .R files:
#' @import ggplot2 gridExtra RColorBrewer
#' @importFrom scales alpha
But this results in another warning:
* installing *source* package 'qdap' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Warning: replacing previous import 'rescale' when loading 'scales'
Warning: replacing previous import 'annotate' when loading 'NLP'
Warning: replacing previous import 'alpha' when loading 'scales'
How do I use roxygen2
's importFrom
tag correctly?
I have read: https://github.com/hadley/devtools/wiki/Namespaces
But I learn best from an example where someone had to do this. I'm unsure of how to format the DESCRIPTION file correctly as well as the use of roxygen2
tags to avoid:
* checking whether package ‘qdap’ can be installed ... [10s/10s] WARNING
Found the following significant warnings:
Warning: replacing previous import ‘annotate’ when loading ‘NLP’
Warning: replacing previous import ‘rescale’ when loading ‘scales’
Here is the qdap GitHub Repo
@import
is evil. These "replacing previous import warnings" multiply as you start importing NAMESPACES that import other NAMESPACES. – Robertson@import
and replace with:@importFrom
? If only people named their functions in elvish and other obscure languages. – Disaffectggplot2
in depends but he conflicts withNLP
. Is there a way to keepggplot2
in depends and not have it squawk? – Disaffect@autoImports
which mostly automatically figures out which functions to import. – Hamartia@autoImports
no longer in the pipeline? I see on the repo "Roxygen development activity has shifted to roxygen2." – Woodchuck