This amounts to a convenience function for tidy manipulations.
Examples
rset <- reshape_set(xpdb_set)
# Properties (exposed and top-level) can be seen. xpdb objects are nested in the xpdb column.
rset %>% dplyr::select(-xpdb) %>% dplyr::glimpse()
#> Rows: 4
#> Columns: 4
#> $ label <chr> "mod1", "mod2", "fix1", "fix2"
#> $ parent <named list> NA, "mod1", "mod2", "fix1"
#> $ base <lgl> FALSE, FALSE, FALSE, FALSE
#> $ focus <lgl> FALSE, FALSE, FALSE, FALSE
unreshape_set(rset)
#>
#> ── xpose_set object ────────────────────────────────────────────────────────────
#> • Number of models: 4
#> • Model labels: mod1, mod2, fix1, and fix2
#> • Number of relationships: 3
#> • Focused xpdb objects: none
#> • Exposed properties: none
#> • Base model: none
# The reversibility of reshaping can be confirmed:
identical(xpdb_set,reshape_set(xpdb_set) %>% unreshape_set())
#> [1] TRUE