Title: | Convenience package for installing R-packages on UiO TSD |
---|---|
Description: | Some packages are hard to install on the secure closed server of the University of Oslo, TSD This package has some functions to help users more easily install packages to TSD that cannot be installed using the mini-CRAN service within TSD. |
Authors: | Athanasia Mo Mowinckel [aut, cre] |
Maintainer: | Athanasia Mo Mowinckel <[email protected]> |
License: | CC BY 4.0 |
Version: | 0.1.03 |
Built: | 2024-11-01 11:17:55 UTC |
Source: | https://github.com/capro-uio/tsdrtools |
Create install_error
as_install_error(x)
as_install_error(x)
x |
list to make install_error |
Create tsdrtools_install
as_tsdrtools_install(x)
as_tsdrtools_install(x)
x |
list to make tsdrtools_install |
Create tsdrtools_status
as_tsdrtools_status(x)
as_tsdrtools_status(x)
x |
list to make tsdrtools_status |
R core packages
core_pkgs()
core_pkgs()
character vector of R core-packages
Extract error logs from tsdrstools_install-object
error_logs(x, package = NULL)
error_logs(x, package = NULL)
x |
object of class tsdrstools_install |
package |
NULL or character vector of package errors to extract. If NULL extracts all. |
list of errors
## Not run: status <- tsd_package_install("devtools.zip") error_logs(status) ## End(Not run)
## Not run: status <- tsd_package_install("devtools.zip") error_logs(status) ## End(Not run)
This function will return all package dependencies for any given package, including backwards dependency for all. The function mainly prints out the dependency tree in the console, but also returns all packages required for build (uniquely).
get_dependency_tree( package, i = 1, type = c("Depends", "Imports"), repos = getOption("repos"), verbose = TRUE, ... )
get_dependency_tree( package, i = 1, type = c("Depends", "Imports"), repos = getOption("repos"), verbose = TRUE, ... )
package |
name of package. character. |
i |
integer. Used in recursive call to package dependency retrieval. |
type |
Character vector, a subset of c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances") |
repos |
character vector. Addresses of CRAN mirror(s) |
verbose |
logical. If function should be talkative. |
... |
additional arguments to functions |
character vector of unique packages
Constructor for install_error
install_error(x)
install_error(x)
x |
named list of installation errors |
Validate install_error
is_install_error(x)
is_install_error(x)
x |
an object |
Validate tsdrtools_install
is_tsdrtools_install(x)
is_tsdrtools_install(x)
x |
an object |
Validate tsdrtools_status
is_tsdrtools_status(x)
is_tsdrtools_status(x)
x |
an object |
Validate install_error
is.install_error(x)
is.install_error(x)
x |
an object |
Validate tsdrtools_status
is.tsdrtools_status(x)
is.tsdrtools_status(x)
x |
an object |
Certain R-packages require workarounds to install on offline servers. This function will check if the given package has such a work-around and return said workaround for the type of process asked (prepare or install).
package_workarounds(package, folder, type, verbose = TRUE)
package_workarounds(package, folder, type, verbose = TRUE)
package |
name of package. character. |
folder |
character. folder to place all necessary files in |
type |
character vector of either "prepare" or "install". This indicates if the workaround for install-process or prepare-process should be returned. |
verbose |
logical. If function should be talkative. |
stringi requires download of a bundle
to work. If we want to install offline,
the bundle needs to be downloaded and
ported with the package tar.
For type = "prepare"
the bundle is
downloaded into the folder with the pacakge
tars.
For install, the call to R CMD INSTALL
is given the path to the bundle during installation,
which will stop it from attempting to
download the bundle during install.
stringi_workaround(folder, type, verbose = TRUE)
stringi_workaround(folder, type, verbose = TRUE)
folder |
character. folder to place all necessary files in |
type |
character vector of either "prepare" or "install". This indicates if the workaround for install-process or prepare-process should be returned. |
verbose |
logical. If function should be talkative. |
After downloading and preparing the
packages for install outside of TSD
using the tsd_package_prepare
function, install said packages using
this function.
tsd_package_install( zip_file, lib = .libPaths()[1], opts = "", verbose = TRUE, ... )
tsd_package_install( zip_file, lib = .libPaths()[1], opts = "", verbose = TRUE, ... )
zip_file |
path to zipped file |
lib |
library folder to install to |
opts |
optional arguments to 'R CMD INSTALL' |
verbose |
logical. If function should be talkative. |
... |
additional arguments to functions |
vector of successful or failed package installs
## Not run: # prepare a package first tsd_package_prepare("devtools") tsd_package_install("devtools.zip") ## End(Not run)
## Not run: # prepare a package first tsd_package_prepare("devtools") tsd_package_install("devtools.zip") ## End(Not run)
This function will download a package
with all its dependencies to a zipped archive,
to them be installed within TSD using
tsd_package_install
.
tsd_package_prepare( package, folder = package, repos = getOption("repos"), verbose = TRUE, zip = TRUE, ... )
tsd_package_prepare( package, folder = package, repos = getOption("repos"), verbose = TRUE, zip = TRUE, ... )
package |
name of package. character. |
folder |
character. folder to place all necessary files in |
repos |
character vector. Addresses of CRAN mirror(s) |
verbose |
logical. If function should be talkative. |
zip |
logical, if folder should be zipped at the end |
... |
additional arguments to functions |
returns nothing, but creates a folder and zip archive
## Not run: tsd_package_prepare("devtools") tsd_package_prepare("dplyr", folder = "dplyr_pkg") tsd_package_prepare("dplyr", repos = "https://cran.uib.no/", verbose = FALSE) ## End(Not run)
## Not run: tsd_package_prepare("devtools") tsd_package_prepare("dplyr", folder = "dplyr_pkg") tsd_package_prepare("dplyr", repos = "https://cran.uib.no/", verbose = FALSE) ## End(Not run)
Constructor for tsdrtools_install
tsdrtools_install(success, error_logs)
tsdrtools_install(success, error_logs)
success |
data.frame of class |
error_logs |
list of class |
Constructor for tsdrtools_status
tsdrtools_status(success, pkg, version)
tsdrtools_status(success, pkg, version)
success |
character vector of "success" or "failed" |
pkg |
character vector of packages |
version |
character vector of versions |