In trying to create a local R package, I listed some dependent packages as Depends:
...
Description: NA
License: GPL-2
Depends:R (>= 2.15.0),
survival,
PropCIs,
boot,
msm,
reshape2
LazyData: true
But I got these message by run R CMD check:
*checking dependencies in R code ... NOTE
Packages in Depends field not imported from:
‘PropCIs’ ‘boot’ ‘msm’ ‘reshape2’ ‘survival’
These packages need to be imported from (in the NAMESPACE file)
for when this namespace is loaded but not attached.
Then I use manually added these packages to NAMESPACE file, but it does work and the import lines were deleted automatically after checking.
Another weird thing is the checking process showed:
R CMD check succeeded
But the files then disappeared or deleted systematically/automatically.
May somebody know the reasons?
Open R via your preferred method (icon on desktop, Start Menu, dock, etc.) Click “Packages” in the top menu then click “Install package(s)”. Choose a mirror that is closest to your geographical location. Now you get to choose which packages you want to install.
Namespaces allow the package writer to hide functions and data that are meant only for internal use, Namespaces prevent functions from breaking when a user (or other package writers) picks a name that clashes with one in the package, and. Namespaces provide a way to refer to an object within a particular package.
A dependency is a code that your package needs to run. Dependencies are managed by two files. The DESCRIPTION manages dependencies at the package level; i.e. what packages needs to be installed for your package to work. R has a rich set of ways to describe different types of dependencies.
Just add the following lines to your roxygen code:
@import PropCIs boot msm reshape2 survival
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With