I tried for hours to create a package in R and worry a little desperately about how slowly I progress. I managed to build the package pretty quickly without dependencies, everything works fine. Due to the recommendations in several posts, I use R Studio, devtools and Roxygen2 (while on Windows). I have problems with dependencies when I CHECK (for example, using devtools :: check ()):
checking dependencies in R-code ... NOTE. The namespace in the Import field is not imported from: 'ggplot2' All declared Imports should be used. See the DESCRIPTION file information in the Creating R Packages chapter of the Writing R-Extensions guide.
In addition, check () deletes the line import(ggplot2) in NAMESPACE. If I check (document = F), it gives a cryptic error about the digest package that is not loaded. I read “Writing R-Extensions” - 1.1.3 “Package Dependencies” and “Hadley Wiki” on how to write packages, but could not solve my problem. DESCRIPTION and NAMESPACE files from other R packages from CRAN do not look different for mine (for my eyes)?
Question: What am I doing wrong? Sorry for that basic question, but I'm at a loss and most of the walkthroughs I've seen so far stop before explaining the dependencies.
So far I have 3 files:
A DESCRIPTION:
Package: test Type: Package Title: Foo Version: 1.0 Date: 2014-03-21 Author: Bar Maintainer: Foo < bar@mail.com > Description: Blubb Imports: ggplot2 License: GPL-3
A NAMESPACE:
export(is.equal.null) import(ggplot2)
AR file:
r package dependencies
Andarin
source share