Fills in missing configuration values with defaults from the schema. This ensures the configuration has all expected values even if the user only provided a subset.
Examples
schema <- create_config_schema(
properties = list(
n_samples = schema_integer(default = 100L),
method = schema_string(default = "arima"),
verbose = schema_boolean(default = FALSE)
)
)
# Partial config - only n_samples provided
config <- list(n_samples = 500L)
full_config <- apply_config_defaults(config, schema)
# full_config now has:
# $n_samples = 500L (user value preserved)
# $method = "arima" (default applied)
# $verbose = FALSE (default applied)