update_record {starschemar} | R Documentation |
Update a dimension record with a set of values
Description
For a dimension, given the primary key of one record, it adds an update to the set of updates that modifies the combination of values of the rest of attributes of the selected record so that they become those given.
Usage
update_record(updates = NULL, dimension, old, values = vector())
## S3 method for class 'record_update_set'
update_record(updates = NULL, dimension, old, values = vector())
Arguments
updates |
A |
dimension |
A |
old |
A number, primary key of the record to modify. |
values |
A vector of character values. |
Details
Primary key is only used to get the combination of values easily. The update is defined exclusively from the rest of values.
Value
A record_update_set
object.
See Also
Other data cleaning functions:
get_conformed_dimension()
,
get_conformed_dimension_names()
,
get_dimension()
,
get_dimension_names()
,
match_records()
,
modify_conformed_dimension_records()
,
modify_dimension_records()
,
record_update_set()
,
update_selection()
,
update_selection_general()
Examples
dim_names <- st_mrs_age |>
get_dimension_names()
where <- st_mrs_age |>
get_dimension("where")
# head(where, 2)
updates <- record_update_set() |>
update_record(
dimension = where,
old = 1,
values = c("1", "CT", "Bridgeport")
)