This function changes the tags
of a safeframe
object, using the same
syntax as the constructor make_safeframe()
.
Arguments
- x
a
data.frame
or atibble
- ...
<
dynamic-dots
> A named list with variable names inx
as list names and the tags as list values. Values set toNULL
remove the tag When specifying tags, please also seedefault_values
.
See also
make_safeframe()
to create a safeframe
object
Examples
## create a safeframe
x <- make_safeframe(cars, speed = "Miles per hour")
tags(x)
#> $speed
#> [1] "Miles per hour"
#>
## add new tags and fix an existing one
x <- set_tags(x, dist = "Distance")
tags(x)
#> $speed
#> [1] "Miles per hour"
#>
#> $dist
#> [1] "Distance"
#>
## remove tags by setting them to NULL
old_tags <- tags(x)
x <- set_tags(x, speed = NULL, dist = NULL)
tags(x)
#> named list()
## setting tags providing a list (used to restore old tags here)
x <- set_tags(x, !!!old_tags)
tags(x)
#> $speed
#> [1] "Miles per hour"
#>
#> $dist
#> [1] "Distance"
#>