Upgrades data created by older Pmetrics versions to the current schema.
In particular, the former observation-occasion column, block, is renamed
to occasion throughout data frames embedded in the supplied object.
PM_upgrade() is called automatically by Pmetrics object constructors, so
most users only need it when working directly with an older saved data frame
or list. Re-save an upgraded object to make the conversion permanent.
Examples
old_data <- data.frame(id = 1, block = 1)
PM_upgrade(old_data)
#> Warning: The `block` column in Pmetrics data was deprecated in Pmetrics 3.2.7.
#> ℹ Please use the `occasion` column instead.
#> ℹ The object was upgraded automatically in memory. Re-save it to make this
#> change permanent.
#> id occasion
#> 1 1 1