Title: | Automated Personal Package Setup |
---|---|
Description: | Functions to setup a personal R package that attaches given libraries and exports personal helper functions. |
Authors: | Sebastian Carl [aut, cre] |
Maintainer: | Sebastian Carl <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.3 |
Built: | 2024-10-29 03:46:44 UTC |
Source: | https://github.com/mrcaseb/personalr |
A function to setup a new personal package or update an existing package.
setup_package(path, packagename, core = NULL)
setup_package(path, packagename, core = NULL)
path |
The path in which the package shall be created. If it exists, it is used. If it does not exist, it is created, provided that the parent path exists. |
packagename |
The name of the newly generated package. It will be checked to make sure it meets R package naming conventions. |
core |
A vector or list containing package names that shall be attached when the newly generated package is loaded. The packages must be installed on the current system, otherwise an error will be shown. |
# create package "mypackage" in temporary directory with # the core packages dplyr, glue and purrr withr::with_tempdir({ install.packages( c("dplyr", "glue", "purrr"), repos = "http://cran.us.r-project.org" ) setup_package( path = tempdir(), packagename = "mypackage", core = c("dplyr", "glue", "purrr") ) })
# create package "mypackage" in temporary directory with # the core packages dplyr, glue and purrr withr::with_tempdir({ install.packages( c("dplyr", "glue", "purrr"), repos = "http://cran.us.r-project.org" ) setup_package( path = tempdir(), packagename = "mypackage", core = c("dplyr", "glue", "purrr") ) })
Updates the "core" of a personal package created with personalr. It can either append another package to the current core or overwrite it with a new core.
update_core(path, packagename, core = NULL, append = TRUE)
update_core(path, packagename, core = NULL, append = TRUE)
path |
The path in which the package shall be created. If it exists, it is used. If it does not exist, it is created, provided that the parent path exists. |
packagename |
The name of the newly generated package. It will be checked to make sure it meets R package naming conventions. |
core |
A vector or list containing package names that shall be attached when the newly generated package is loaded. The packages must be installed on the current system, otherwise an error will be shown. |
append |
If |