
Validate a shinyplanr deployment configuration before saving
Source:R/validate_config.R
validate_shinyplanr_data.RdRuns a comprehensive set of checks on a config list produced by
setup-app.R before it is saved to
config/shinyplanr_config.rds. This function is intended to be
called at the end of the deployer's setup-app.R script, immediately
before saveRDS(), to catch data problems early rather than at
runtime.
Arguments
- config_list
A named list. The config object built in
setup-app.R, containing at minimum the keys listed in.shinyplanr_required_keys.- strict
Logical. If
TRUE(default), the function stops immediately with a clear error message on the first failed check. IfFALSE, all checks are run and a summary report is returned invisibly; warnings are issued for each failure.
Value
When strict = FALSE, invisibly returns a named list of
logical values (TRUE = passed, FALSE = failed) for each
check. When strict = TRUE, returns invisible(TRUE) if all
checks pass.
Checks performed
Dictcontains all required columns.All
Dict$nameVariablevalues for Feature/Cost/LockIn/LockOut types are present as columns inraw_sf.raw_sfCRS matchesoptions$cCRS.bndryandoverlayare validsfobjects.bndryCRS matchesraw_sfCRS.No Feature columns in
raw_sfare entirely zero or entirelyNA(would cause prioritizr to error or produce meaningless results).txis a list with awelcomeelement, each entry of which containstitleandtextcharacter fields.All
tx_*text fields are non-NULLcharacter strings.Feature-type Dict rows have
targetMin,targetMax, andtargetInitialvalues within the 0-100 range.