Skip to content
Prev 9002 / 12125 Next

[R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

I would use conditional returns to make the code more readable (see below) and then run the examples conditionally.

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)
}

# In the examples:
if(check_limma()){
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)
}

My 2 cents ?

Berry

-------------------------------------

Thread (32 messages)

Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 16 Ivan Krylov How to declare Bioconductor Dependencies in the Description File of my R Package Mar 16 Tiago Olivoto How to declare Bioconductor Dependencies in the Description File of my R Package Mar 16 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 16 Duncan Murdoch How to declare Bioconductor Dependencies in the Description File of my R Package Mar 16 Tiago Olivoto How to declare Bioconductor Dependencies in the Description File of my R Package Mar 16 Tiago Olivoto How to declare Bioconductor Dependencies in the Description File of my R Package Mar 16 Ivan Krylov How to declare Bioconductor Dependencies in the Description File of my R Package Mar 16 Martin Morgan How to declare Bioconductor Dependencies in the Description File of my R Package Mar 16 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Duncan Murdoch How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Ivan Krylov How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Ivan Krylov How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Duncan Murdoch How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Uwe Ligges How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Uwe Ligges How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Ivan Krylov How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Duncan Murdoch How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Simon Urbanek How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 17 Berry Boessenkool How to declare Bioconductor Dependencies in the Description File of my R Package Mar 18 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 18 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 20 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 20 Ivan Krylov How to declare Bioconductor Dependencies in the Description File of my R Package Mar 20 Ruff, Sergej How to declare Bioconductor Dependencies in the Description File of my R Package Mar 20 Ivan Krylov How to declare Bioconductor Dependencies in the Description File of my R Package Mar 20