Skip to contents


library(saferDev)


Datasets

req.pkg <- "ggplot2"
path <- "blablabla"


Datasets info

req.pkg # Character vector of package names
> [1] "ggplot2"
path # character vector specifying the absolute pathways of the directories, this lib_path will return an error
> [1] "blablabla"


Argument req_package

is_package_here(req_package = req.pkg) # check if the package is in the computer


Argument safer_check

is_package_here(
    req_package = req.pkg,
    safer_check = TRUE
) # check if the package is in the computer, safer_check = TRUE, checkings are performed before main code running 


Argument lib_path and error_text

is_package_here(
    req_package = req.pkg,
    lib_path = ".", # absolute pathways of the directories containing the required packages if not in the default directories.
    error_text = "TEXT ADDED" # add information in error messages returned by the function.
)
> Error: 
> 
> ================
> 
> ERROR IN saferDev:::.pack_and_function_check() INSIDE saferDev::is_package_here()TEXT ADDED
> 
> REQUIRED PACKAGE:
> saferDev
> MUST BE INSTALLED IN ONE OF THESE FOLDERS:
> /__w/saferDev/saferDev/vignettes/articles
> /usr/local/lib/R/site-library
> /usr/local/lib/R/library
> 
> ================


All the arguments

is_package_here(
    req_package = req.pkg,
    safer_check = TRUE, # perform some "safer" checks? Warning : always set this argument to FALSE if all_args_here() is used inside another safer function.
    lib_path = NULL, # absolute pathways of the directories containing the required packages if not in the default directories.
    error_text = "" # add information in error messages returned by the function.
) # check if the package is in the computer

```