The path is computed based on inputs and settings; it may or may not exist.
Usage
cas_get_base_folder(
...,
level = c("base", "project", "website"),
custom_path = NULL
)Arguments
- ...
Passed to
cas_get_options().- level
Defaults to "base". Valid values are "website", "project", and "base".
- custom_path
Defaults to NULL. If given, all other parameters and settings are ignored, and this value is returned.
Examples
cas_set_options(
base_folder = fs::path(tempdir(), "R", "castarter_data"),
db_folder = fs::path(tempdir(), "R", "castarter_data"),
project = "example_project",
website = "example_website"
)
cas_get_base_folder()
#> /tmp/RtmprKtXJ9/R/castarter_data
cas_get_base_folder(level = "website")
#> /tmp/RtmprKtXJ9/R/castarter_data/example_project/example_website
cas_get_base_folder(level = "project")
#> /tmp/RtmprKtXJ9/R/castarter_data/example_project
cas_get_base_folder(level = "base")
#> /tmp/RtmprKtXJ9/R/castarter_data
cas_get_base_folder(custom_path = fs::path(tempdir(), "custom_path"))
#> /tmp/RtmprKtXJ9/custom_path