Functions to list, select, remove, add, update, and move row operations in
your mighty_domain() objects.
Arguments
- x
mighty_domain()Object to manipulate.- id
character()Id of the row(s) to remove, add, or move.- ...
Additional properties to add for the row, e.g. a
label = "my row".- .pos
integer(1)Position to put or move the row to. Default places the row as the last.
Examples
# Load example configuration
x <- mighty_domain(
file = system.file("examples", "advs.yml", package = "mighty.metadata")
)
# List all rows defined
list_rows(x)
#> [1] "BASELINE"
# Add a new row
y <- x |>
add_row(id = "NEW")
list_rows(y)
#> [1] "BASELINE" "NEW"
# Remove the new row again
y |>
remove_rows("NEW") |>
list_rows()
#> [1] "BASELINE"
# Update an existing row
x |>
update_row(id = "BASELINE", method = "Updated method") |>
select_row(id = "BASELINE") |>
str()
#> List of 2
#> $ id : chr "BASELINE"
#> $ method: chr "Updated method"
# Select a specific row
select_row(x, id = "BASELINE") |>
str()
#> List of 2
#> $ id : chr "BASELINE"
#> $ method: chr "Add baseline visit as a new row"
