This function determines the behaviour to adopt when tagged variables of a
linelist
are lost e.g. through subsetting. This is achieved using options
defined for the linelist
package.
Usage
lost_tags_action(action = c("warning", "error", "none"), quiet = FALSE, x)
get_lost_tags_action()
Details
The errors or warnings generated by linelist in case of tagged
variable loss has a custom class of linelist_error
and linelist_warning
respectively.
Examples
# reset default - done automatically at package loading
lost_tags_action()
#> Lost tags will now issue a warning.
# check current value
get_lost_tags_action()
#> [1] "warning"
# change to issue errors when tags are lost
lost_tags_action("error")
#> Lost tags will now issue an error.
get_lost_tags_action()
#> [1] "error"
# change to ignore when tags are lost
lost_tags_action("none")
#> Lost tags will now be ignored.
get_lost_tags_action()
#> [1] "none"
# reset to default: warning
lost_tags_action()
#> Lost tags will now issue a warning.