Hi Maciej and Jeff, Thanks for your responses. Duncan Murdoch offered a suggestion about using .onAttach instead, so I plan to give that a shot. If the NOTE still pops up, then I may drop the message altogether and instead include some text about Python/numpy installation in the vignette. FYI, the package includes a function that provides the same functionality without the need to call Python, albeit with longer compute times.
Best, Vonn From: Maciej Nasinski [mailto:nasinski.mac...@gmail.com] Sent: Saturday, September 18, 2021 3:35 AM To: Jeff Newmiller <jdnew...@dcn.davis.ca.us> Cc: Walter, Vonn <vwalt...@pennstatehealth.psu.edu>; r-package-devel@r-project.org Subject: Re: [R-pkg-devel] NOTE related to Miniconda installation Attention: This email originated outside of Penn State Health. Use caution when clicking links or opening attachments. Hey, First of all I see that you need a numpy package so I assume some matrix/tensor operations are done. There is no difference in performance between R and Python if you are using proper BLAS and LAPACK. Windows users might use MRO MKL, Linux users openblas and the Mac os vecLib has to be activated. I done some benchmarks some time ago, https://github.com/Polkas/RPbenchmarks<https://urldefense.com/v3/__https:/github.com/Polkas/RPbenchmarks__;!!Ls64Rlj6!kL0561pdH-8oq5ytLKAlC-Euctbq1fg-2itjGkFjGq8-IjU-SU60uOHmvZxKEIPl2OsnSTO5tw$>. Unfortunately they are done only partly. If we talking about system requirements as i see you need only python and a one library numpy. As i remember rsconnect using python script and do not need any additional system requirements. https://github.com/rstudio/rsconnect/blob/main/inst/resources/environment.py<https://urldefense.com/v3/__https:/github.com/rstudio/rsconnect/blob/main/inst/resources/environment.py__;!!Ls64Rlj6!kL0561pdH-8oq5ytLKAlC-Euctbq1fg-2itjGkFjGq8-IjU-SU60uOHmvZxKEIPl2OtiXvOhXA$>. they run it if python is available, if not other code is executed. Have a nice day. Best, Maciej Nasinaki On Sat, Sep 18, 2021, 05:27 Jeff Newmiller <jdnew...@dcn.davis.ca.us<mailto:jdnew...@dcn.davis.ca.us>> wrote: I can't really see why it should be "recommended" to handle installing system requirements inside an R package. There are many ways to satisfy such requirements that would not involve miniconda. If you were determined to provide such support, doing so in a normal function documented in a vignette seems more appropriate. On September 17, 2021 11:55:07 AM PDT, "Walter, Vonn" <vwalt...@pennstatehealth.psu.edu<mailto:vwalt...@pennstatehealth.psu.edu>> wrote: >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]] > >______________________________________________ >R-package-devel@r-project.org<mailto:R-package-devel@r-project.org> mailing >list >https://stat.ethz.ch/mailman/listinfo/r-package-devel<https://urldefense.com/v3/__https:/stat.ethz.ch/mailman/listinfo/r-package-devel__;!!Ls64Rlj6!kL0561pdH-8oq5ytLKAlC-Euctbq1fg-2itjGkFjGq8-IjU-SU60uOHmvZxKEIPl2OuiRkyttQ$> -- Sent from my phone. Please excuse my brevity. ______________________________________________ R-package-devel@r-project.org<mailto:R-package-devel@r-project.org> mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel<https://urldefense.com/v3/__https:/stat.ethz.ch/mailman/listinfo/r-package-devel__;!!Ls64Rlj6!kL0561pdH-8oq5ytLKAlC-Euctbq1fg-2itjGkFjGq8-IjU-SU60uOHmvZxKEIPl2OuiRkyttQ$> [[alternative HTML version deleted]] ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel