Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

These packages need to be imported from (in the NAMESPACE file)

Tags:

package

r

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?

like image 292
David Z Avatar asked May 07 '14 14:05

David Z


People also ask

How do I import a package into R?

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.

What is a namespace in R?

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.

What are R dependencies?

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.


1 Answers

Just add the following lines to your roxygen code:

@import PropCIs boot msm reshape2 survival
like image 105
kleindotuk Avatar answered Oct 20 '22 13:10

kleindotuk