I implemented a function to check if limma is available as suggested by Berry and Tiago.
It works fine when limma is pre-installed. When Limma is not pre-installed, I get the following Note: "Package suggested but not available for checking: 'limma'". Seems like the functions isn't installing limma. Is there something I am missing? I added BiocManager and limma to the suggests and utils to Imports. check_limma <- function() # Returns TRUE if available, FALSE otherwise { if(requireNamespace("limma", quietly=TRUE)) return(TRUE) if(!interactive()) return(FALSE) inst <- menu(c("Yes", "No"), title="Package {limma} required but not installed.\nDo you want to install it now?") if(inst != 1) { message("To run this example, first install {limma} following the directions at 'https://bioconductor.org/packages/limma'") return(FALSE) } # the following could be wrapped in try and conditionally return TRUE / FALSE if(!requireNamespace("BiocManager", quietly=TRUE)) install.packages("BiocManager", quiet=TRUE) BiocManager::install("limma", update=FALSE, ask=FALSE, quiet=TRUE) return(TRUE) } The check also never brings up the menu to ask me, if limma should be installed. Is that normal or should I change something about the function. Regards, Sergej ________________________________ Von: Tiago Olivoto <tiagooliv...@gmail.com> Gesendet: Donnerstag, 16. M�rz 2023 17:36:47 An: Ruff, Sergej Cc: r-package-devel@r-project.org Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package Hi, My package pliman depends on EBImage which is in Bioconductor. I have created a function check_ebi() <https://github.com/TiagoOlivoto/pliman/blob/e6efc4b6a2396600939e308c235aeb9ab47af375/R/utilities.R#L534> that is called in .onAttach() <https://github.com/TiagoOlivoto/pliman/blob/master/R/zzz.R#L36> and checks if EBImage is installed. If not, the function asks the user to install it. Both EBImage and BiocManager are listed as suggests <https://github.com/TiagoOlivoto/pliman/blob/master/DESCRIPTION#L22> I believe that this could be a possible solution Best regards, Olivoto Em qui., 16 de mar. de 2023 �s 11:18, Ruff, Sergej <sergej.r...@tiho-hannover.de<mailto:sergej.r...@tiho-hannover.de>> escreveu: I am currently building a package which uses the "limma"-package as a dependency. I want to submit my package to CRAN. Do I need to declare Bioconductor-dependencies such as Limma differently in the Description-File of my Package? The Check-Function in R shows no Notes, Warnings or Errors, but I am not sure if that means that limma will install when installing my package from CRAN. Currently I am declaring limma like this: Suggests: limma Can CRAN identify that limma is a Bioconductor-Package and will it Limma install, when installing my package from CRAN? [[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 [[alternative HTML version deleted]]
______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel