Short question
I am building a package foo
. I want to distribute the binary package for foo
. Does installing the binary package using the following command automatically install the dependencies? Is there a way to distribute the binary package so that the users don't have to explicitly install dependencies?
install.packages("foo_1.0.zip", type="win.binary", dependencies=TRUE)
details:
I am using R4.2.2 on Windows.
I build the package using:
R CMD INSTALL --build foo
resulting in `foo_1.0.zip
foo
depends on the package collections
.
DESCRIPTION
file contains the following line Imports: collections(>= 0.3.6)
NAMESPACE
File contains the following line:
importFrom(collections, dict)
If a user doesn't have the package collections
installed, and tries to install foo
on Windows using install.packages("foo_1.0.zip", type="win.binary", dependencies=TRUE)
, the package collections
is not automatically installed but the installation for foo
succeeds without any error. When the user tries to use it with library(foo)
, they get the following error because of the importFrom line in NAMESPACE.
Error: package or namespace load failed for 'foo' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called 'collections'
I don't plan to distribute the package on CRAN.