On Mar 18, 2023, at 1:29 AM, Ruff, Sergej <Sergej.Ruff at tiho-hannover.de> wrote:
Really.Whats a problem i have when all dependencies arent prei installed. I thought the problem would be solved once my package is available on CRAN.
Here is a recent question I had regarding the same issue:
I am currently working on a r-package. I would like to submit my r package to CRAN, but I have a question regarding dependency installations on CRAN.
I have almost finished my package, added the required dependencies to the NAMESPACE and DESCRIPTION files as Imports, and get no errors or warnings
when running the check in Rstudio. The package runs on the pc, where I?ve built the package, but when I install the package on a pc, where the dependencies
are not preinstalled, I get the following error:
ERROR:
dependencies 'depth', 'geometry' are not available for package 'packagename'
* removing 'C:/Users/156932/AppData/Local/Programs/R/R-4.2.1/library/packagename'
Warning in install.packages : installation of package ?packagename? had non-zero exit status
The problem is that a local installation of my package (via USB-stick for example) can?t install the dependencies from CRAN.
The package works perfectly fine, if the dependencies are preinstalled.
Now I don?t want to submit my package to CRAN if the end user gets the same error message when installing my package.
Question: After I submit my package to CRAN, will CRAN install dependencies automatically (via "install.packages()"), resolving the issue I have right now?
Or do I have to modify the R-package or the Description-file to make sure my Package can install dependencies?
I provided the dependencies to the NAMESPACE-file as @ImportFrom via the devtools::document()-function. I added the dependencies to the DESCRIPTION-file via usethis::use_package("x",type="Imports"). The Description looks like this:
License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
Imports:
depth,
geometry,
graphics,
grDevices,
MASS,
mvtnorm,
nlme,
rgl,
stats
So I thought all dependencies would install automatically from CRAN? Is that not the case?