
Upgrade an older BirdFlow object to the current in-memory format
Source:R/upgrade_birdflow.R
upgrade_birdflow.RdConsolidates the back compatibility fixes that were previously scattered
across several functions (predict(), route(), route_between(),
predict_between(), truncate_birdflow(), and others) into one place.
Running upgrade_birdflow() on an already current object is a no-op.
Details
upgrade_birdflow():
Fixes the old
birdFlowr_versionmetadata name typo.Backfills
metadata$timestep_paddingviaget_timestep_padding()if missing.Backfills metadata fields that are missing entirely (added in later versions of the package) with
new_BirdFlow()'s schema defaults, without overwriting any field that's already present.Backfills
dates$weekwith1:52if missing and the model has 52 timesteps.Adds a dynamic mask via
add_dynamic_mask()if the object doesn't already have one.
Examples
# \donttest{
bf <- upgrade_birdflow(BirdFlowExamples::amewoo)
# }