[R-pkg-devel] NOTE related to Miniconda installation

Walter, Vonn vw@|ter1 @end|ng |rom penn@t@tehe@|th@p@u@edu
Fri Sep 17 20:55:07 CEST 2021


Hi Everyone,

I am developing a package (called mypackage in the text below) that uses reticulate to call a Python script for computational efficiency.  At some point during the development of the package I read that it would be good to verify installation of Miniconda.  Thus mypackage includes an onLoad.R file that asks users to either confirm that Miniconda is installed or to proceed with installation on Miniconda.  When I run devtools::check() I get a NOTE related to my onLoad.R file, and this seems to be causing problems when I submit the package to CRAN.  There are no WARNINGs or ERRORs.  Any thoughts would be greatly appreciated.

Thanks,

Vonn

* checking R code for possible problems ... [19s] NOTE
File 'mypackage/R/onLoad.R':
  .onLoad calls:
    packageStartupMessage("You should install miniconda before using this package")

See section 'Good practice' in '?.onAttach'.

Here's the code/text from my onLoad.R file:

#' Perform necessary tasks when the mypackage package is loaded
#'
#'
miniconda_installation <- NULL
miniconda_permission <- NULL
numpy_import <- NULL

.onLoad <- function(libname, pkgname)
                {
                miniconda_installation <- utils::askYesNo("Is miniconda installed?")

                if (isFALSE(miniconda_installation))
                                {
                                miniconda_permission <- utils::askYesNo("Install miniconda?  Downloads 50MB and takes time.")

                                if (isTRUE(miniconda_permission))
                                                {
                                                reticulate::install_miniconda()
                                                } else{
                                                                packageStartupMessage("You should install miniconda before using this package")
                                                                }

                                numpy_import <- reticulate::import("numpy", delay_load = TRUE)
                                }
                }



	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list