Description Usage Arguments Details Examples
View source: R/myBasicFunctions.R
Load a package and install it if it is not installed using CRAN or Bioconductor.
1 2 3 4 | safelyLoadAPackageInCRANorBioconductor(
myPackage,
cranRep = "https://stat.ethz.ch/CRAN/"
)
|
myPackage |
a string with the name of your package |
cranRep |
the repository you want to use, by default it is the Swiss one. |
It will try to load the package with the function require quietly=T. If the package is not installed, it will check if it is in CRAN. If it is not it will use BiocManager if the version of R is above 3.5.0 Or use biocLite if the version is bellow.
1 2 3 4 | # With a bioconductor
safelyLoadAPackageInCRANorBioconductor("GenomicRanges")
# With a CRAN
safelyLoadAPackageInCRANorBioconductor("UpSetR")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.