Compose parts of and complete directory settings controls lists.
Most users will not want or need to change the directory folders and file names, but it is helpful to have them be flexible for certain circumstances, and directory_files, directory_subdirectories, and directory_settings gather them into a set of lists for pipeline functionality. directory_resources dictates the source and version (and any other specialized arguments) for each of the raw resources collected for the directory. time_settings collates the temporal aspects of the data, and can be used to set up alternate forecast timelines for specialized projects and sandboxing.
Usage
directory_settings(
files = directory_files(),
subdirectories = directory_subdirectories(),
resources = directory_resources(),
time = time_settings(),
confidence_level = 0.95,
nsamples = 10000,
save = TRUE,
overwrite = TRUE,
force = FALSE,
unzip_pause = 30,
download_timeout = getOption("timeout")
)
time_settings(
timeseries_start = as.Date("1995-01-01"),
origin = Sys.Date(),
forecast_date = Sys.Date(),
lead_time = 365,
max_lag = 365,
lag_buffer = 60,
lead_time_buffer = 30
)
directory_files(
directory_configuration = "directory_configuration.yaml",
app = "app.R",
newmoons = "newmoons.csv",
covariates = "covariates.csv",
datasets_controls = "datasets_controls.yaml",
models_controls = "models_controls.yaml",
forecasts_evaluations = "forecasts_evaluations.csv",
forecasts_results = "forecasts_results.csv",
forecasts_metadata = "forecasts_metadata.csv",
metadata = "metadata.yaml",
about_md = "about.md",
models_html = "models.html",
models_rmd = "models.Rmd",
rodents_profiles_html = "rodents_profiles.html",
rodents_profiles_csv = "rodents_profiles.csv",
species_names = "species_names.csv"
)
directory_subdirectories(
forecasts = "forecasts",
fits = "fits",
models = "models",
resources = "resources",
data = "data",
www = "www"
)
directory_resources(
PortalData = list(source = "github", version = "latest"),
portalPredictions = list(source = "github", version = NULL),
climate_forecasts = list(source = "NMME", version = as.character(Sys.Date()), data =
list(mintemp = "tasmin", meantemp = "tasmean", maxtemp = "tasmax", precipitation =
"pr"))
)
production_settings(download_timeout = max(getOption("timeout"), 600))
sandbox_settings()Arguments
- files
listofcharacternames of standard files, seedirectory_files.- subdirectories
listofcharacternames of standard subdirectories, seedirectory_subdirectories.- resources
charactername for the resources subdirectory.- time
listof time settings, seetime_settings.- confidence_level
numericconfidence level used in summarizing model output. Must be between0and1.- nsamples
integer(or integernumeric) number of samples used to summarizing model output of sample-based estimates.- save
logicalindicator controlling if the output should be saved out.- overwrite
logicalindicator of whether or not file writing should occur even if a local copy already exists.- force
logicalindicator of whether or not existing files or folders (such as the archive) should be over-written if an up-to-date copy exists (most users should leave asFALSE).- unzip_pause
Positive
integeror integernumericseconds for pausing during steps around unzipping that require time delay.- download_timeout
Positive
integeror integernumericseconds for timeout on downloads. Temporarily overrides the"timeout"option inbase::options.- timeseries_start
Dateafter which historic samples are included in the timeseries fit. Default value is1995-01-01, corresponding to moon 217.- origin
Dateforecast origin. Default is today's date (set usingSys.Date).- forecast_date
Dateof when the forecasts are occurring. Default is today's date (set usingSys.Date).- lead_time
integer(or integernumeric) value for the number of calendar days forward a forecast will cover.
As of version 0.51.0, default is now365, which when divided by 29.5 (duration of a lunar month), gives 13. The previous value was previously 12. We are now using 13 to align with the timestep being a lunar month, and 13 lunar months covers a full calendar year.- max_lag
integer(or integernumeric) maximum number of calendar days that any covariate is lagged for prediction in a model.
Default is365for the logistic covariate models.- lag_buffer
integer(or integernumeric) additional number of calendar days back in time to add to the maximum lag.
Default value of60corresponds to two additional lunar months.- lead_time_buffer
integer(or integernumeric) additional number of calendar days forward in time to forecast.
Default value of30corresponds to one additional lunar month.- directory_configuration
charactername for the directory configuration YAML.- app
charactername for the application R file.- newmoons
charactername for the lunar data csv.- covariates
charactername for the combined historical and forecast covariates csv.- datasets_controls
charactername for the YAML of datasets control list(s).- models_controls
charactername for the YAML of models controls list(s).- forecasts_evaluations
charactername for the forecast evaluations csv.- forecasts_results
charactername for the forecast combination results csv.- forecasts_metadata
charactername for the forecast metadata csv.- metadata
charactername for the Forecast metadata YAML.- about_md
charactername for the md file for the about page of the app.- models_html
charactername for the html file where the models page will be saved for the app.- models_rmd
charactername for the Rmd file for the models page of the app.- rodents_profiles_html
charactername for the html file where the rodents profiles page will be saved for the app.- rodents_profiles_csv
charactername for the csv file containing content for the rodents profiles table for the app.- species_names
charactername for the csv file containing the output fromportalr::rodent_species, withset = "forecasting",type = "table", andtotal = TRUE.- forecasts
charactername for the forecasts subdirectory.- fits
charactername for the fits subdirectory.- models
charactername for the models subdirectory.- data
charactername for the data subdirectory.- www
charactername for the application www helpers subdirectory.- PortalData
listofsourceandversionelements ofcharactervalues for the Portal Data download. Default values retrieve the latest data from github- portalPredictions
listofsourceandversionelements ofcharactervalues for the archive download. Default values point to github, butverison = NULLindicates no download.- climate_forecasts
listofsource,version, anddataelements ofcharactervalues for the climate forecasts download. Default values retrieve the current day's forecast of min, mean, and max temperature and precipitation from the Northwest Knowledge Network's North American Multi-Model Ensemble (NMME) climate forecasts.
Value
Named list of settings for the directory (for directory_settings) or list of settings components (for directory_files, directory_subdirectories, and directory_resources).
See also
Directory orchestration functions:
directory configuration file,
directory creation,
directory filling,
directory paths