Reputation: 5162
I am building a package in R
in a windows environment using Rstudio
, devtools
roxygen2
and Rtools
.
The package is showing no problems in R CMD CHECK
. However when I try to load the package using library("mypkg")
, the packages specified under Imports
in DESCRIPTION
are not being loaded (Loading required package:
message is not there). On using pkgDepends("mypkg")
, the $Depends
is shown as character(0)
.
I have to load the required packages using library()
for mypkg
to function.
I am using namespace imports instead of package::function()
syntax. All the required packages are there in the NAMESPACE
as imports()
.
Why is this happening? How to solve this?
Upvotes: 2
Views: 1380
Reputation: 121067
That's the correct behaviour. Imports
just means that code inside your package can see the functions that you import from other packages. The other packages aren't placed on the search
path like with Depends
.
Further reading:
Better explanation of when to use Imports/Depends
Upvotes: 2