cas_get_base_path: Build full path to base folder where batches of files will be...

View source: R/cas_get_base_path.R

cas_get_base_pathR Documentation

Build full path to base folder where batches of files will be stored.

Description

For more information on how the full path is determined, see details.

Usage

cas_get_base_path(
  create_folder_if_missing = NULL,
  custom_path = NULL,
  custom_folder = NULL,
  index = FALSE,
  file_format = "html",
  ...
)

Arguments

create_folder_if_missing

Logical, defaults to NULL. If NULL, it will ask before creating a new folder. If TRUE, it will create it without asking.

custom_path

Defaults to NULL. If given, overrides all other inputs, and is returned as given.

custom_folder

Defaults to NULL. Folder name within the website folder is typically determined by file_format and either index or contents; if you prefer another option, different from both index and contents, you can set it using the custom_folder argument.

file_format

Defaults to html. Used to determine folder name, and internally to assume contents type when using functions such as cas_extract().

...

Passed to cas_get_options().

Details

  • base_folder - path to the folder where all project files are expected to be stored. Can be retrieved with cas_get_base_folder(level = "base"), can be set for the whole session with ⁠cas_set_options(base_folder = fs::path(fs::path_temp(), "castarter")⁠.

  • project - project name, typically set with ⁠cas_set_options(project = "example_project)⁠

  • website - website name, typically set with ⁠cas_set_options(website = "example_project)⁠

  • a combination of file_format and either index, contents, or something different if set with the custom_folder argument.

Value

Path to base folder. A character vector of length one of class fs_path.

Examples

set.seed(1)
cas_set_options(project = "example_project",
                website = "example_website", 
                base_folder = fs::path(fs::path_temp(), "castarter"))

cas_get_base_path(create_folder_if_missing = FALSE)

cas_get_base_path(file_format = "html", 
                  create_folder_if_missing = FALSE)

cas_get_base_path(file_format = "xml", 
                  create_folder_if_missing = FALSE)

cas_get_base_path(index = TRUE,
                  create_folder_if_missing = FALSE)

giocomai/castarter documentation built on June 12, 2025, 8:49 p.m.