Skip to contents

add or update field-specific metadata in a fr_tdr object

Usage

update_field(x, field, ...)

Arguments

x

a fr_tdr object

field

character name of field in x to update

...

table schema field descriptors (e.g., title, description)

Value

an fr_tdr object containing the updated field

Examples

my_mtcars <-
  mtcars |>
  as_fr_tdr(name = "mtcars") |>
  update_field("mpg", title = "Miles Per Gallon")

S7::prop(my_mtcars, "schema")
#> mpg
#> - type: number
#> - title: Miles Per Gallon
#> cyl
#> - type: number
#> disp
#> - type: number
#> hp
#> - type: number
#> drat
#> - type: number
#> wt
#> - type: number
#> qsec
#> - type: number
#> vs
#> - type: number
#> am
#> - type: number
#> gear
#> - type: number
#> carb
#> - type: number