Description Usage Arguments Value Author(s) See Also
The function creates a predefined directory structure and some files to enhance project organization. Among other things it is a wrapper for 'template_params'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | skeleton(project_dir, input_files = c("load_data.R"),
pkg_cran_install = c("utils", "tools", "rmarkdown", "knitr",
"rstudioapi"), pkg_cran_load = c("tidyverse"), pkg_gh_install = NULL,
pkg_gh_load = NULL, input_dir = "files", data_dir = "inst/extdata",
cache_dir = ".cache", fun_dir = "R", spin_index = 0,
cache_index = 999, symlink_dir_input = "in",
symlink_dir_docs = "out/docs", symlink_dir_figure = "out",
rename_symlink_input = TRUE, rename_symlink_docs = TRUE,
rename_symlink_figure = TRUE, rebuild_figures = TRUE,
Rplots_device = "grDevices::png", target_dir_data = "data",
listofdf = "GlobalEnv", data_extension = "RData",
rebuild_target_dir_data = TRUE,
filepath_session_info = "meta/session_info.txt",
filepath_log = "meta/log.csv", filepath_tree = "meta/tree.txt",
filepath_warnings = "meta/warnings.Rout", tree_directory = "getwd()",
include_hidden_tree = FALSE, filepath_pkg_bib = "meta/pkg.bib",
filepath_image = ".RData", autobranch = NULL,
quiet_processing = TRUE, summarize_session_info = FALSE,
summarize_df = FALSE, summarize_memory = FALSE,
summarize_log = FALSE, summarize_git = TRUE,
summarize_tree = FALSE, summarize_warnings = FALSE)
|
project_dir |
Character. File path to your project top level. |
input_files |
character vector. File paths to your input files. Should be found within the directory 'input dir'. Use file extension 'R' or 'Rmd'. |
pkg_cran_install |
Character vector. Package names that should be installed from your default cran mirror. |
pkg_cran_load |
Character vector. Package names that should be installed from your default cran mirror and additionally loaded. |
pkg_gh_install |
Character vector. Package names that should be installed from github. Depends on the package 'devtools'. |
pkg_gh_load |
Character vector. Package names that should be installed from github and additionally loaded. Depends on the package 'devtools'. |
input_dir |
Character. Source directory for your input_files. |
data_dir |
Character. Source directory for raw data. This directory will be monitored. When files change in this directory the cache will be ignored (when using the framework template of the file 'make.R'). |
cache_dir |
Character. Directory for the cache. |
fun_dir |
Character. Directory for user-written functions. When using the framework template of the file 'make.R' all R-Scripts (functions) within this directory will be attached to a predefined environment. |
spin_index |
Integer vector. Subset of input_files that should be spinned. Files extensions other than '.R' will be ignored. (0 = none, 999 = all) |
cache_index |
Integer vector. Subset of input_files that should be cached. (0 = none, 999 = all) |
symlink_dir_input |
Character. Target directory for symbolic links to input_files. Should betreated as read-only. |
symlink_dir_docs |
Character. Target directory for symbolic links to rendered files. Should betreated as read-only. |
symlink_dir_figure |
Character. Target directory for symbolic links to rendered figures. Should betreated as read-only. |
rename_symlink_input |
Logical. Preserve directory structure and filename or collapse directories and rename symbolic links. |
rename_symlink_docs |
Logical. Preserve directory structure and filename or collapse directories and rename symbolic links. |
rename_symlink_figure |
Logical. Preserve directory structure and filename or collapse directories and rename symbolic links. |
rebuild_figures |
Logical. Delete figures before rendering. Choose FALSE if you want to use knitr::cache. |
Rplots_device |
Character. Function that should be passed to write figures of R-files if sourced. E.g. 'grDevices::pdf' or 'grDevices::png'. Choose NULL if you want to write figures manually (e.g. using ggsave for ggplot2-graphics). |
target_dir_data |
Character. Target directory for data. |
listofdf |
Character vector. Specify a vector of dataframes to write. Choose 'GlobalEnv' to write all data frames currently inside your global environment. |
data_extension |
Character. Specify file extension for data frames. Possible values: 'csv', 'RData' and 'rds'. |
rebuild_target_dir_data |
Logical. Delete target_dir_data before writing current data frames. |
filepath_session_info |
Character. Specify file path to write the session info file. |
filepath_log |
Character. Specify file path to write the log file. |
filepath_tree |
Character. Specify file path to write the tree file. |
filepath_warnings |
Character. Specify file path to write the warnings file. |
tree_directory |
Character. Specify input directory as top level for the tree. |
include_hidden_tree |
Logical. Include/Exclude hidden directories and files to build the tree. |
filepath_pkg_bib |
Character. Target filepath to write bib-file of packages. See ?knitr::write_bib() |
filepath_image |
Character. Target filepath to write final image. |
autobranch |
Character. Specify the name of an existing branch. Only if HEAD is pointing to this branch an auto-snapshot will be created. Exception: Choose NULL (default) to ignore branch-dependency. |
quiet_processing |
Logical. Specify if processing of files should be quiet. |
summarize_session_info |
Logical. Should session info be printed to console? |
summarize_df |
Logical. Should a list of written data frames be printed to console? |
summarize_memory |
Logical. Should memory usage be printed to console? |
summarize_log |
Logical. Should a summary of the log file be printed to console? Depends on dplyr. |
summarize_git |
Logical. If TRUE git2r::summary() will be called. |
summarize_tree |
Logical. Should the directory structure (tree) be printed to console? |
summarize_warnings |
Logical. Should filepath_warnings be printed to console? |
The output are several files and directories within your working directory.
Frederik Sachser
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.