lost_tags_action: Check and set behaviour for lost tags

View source: R/lost_tags_action.R

lost_tags_actionR Documentation

Check and set behaviour for lost tags

Description

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()

Arguments

action

a character indicating the behaviour to adopt when tagged variables have been lost: "error" (default) will issue an error; "warning" will issue a warning; "none" will do nothing

quiet

a logical indicating if a message should be displayed; only used outside pipelines

x

deprecated

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.

Value

returns NULL; the option itself is set in options("linelist")

Examples

# reset default - done automatically at package loading
lost_tags_action()

# check current value
get_lost_tags_action()

# change to issue errors when tags are lost
lost_tags_action("error")
get_lost_tags_action()

# change to ignore when tags are lost
lost_tags_action("none")
get_lost_tags_action()

# reset to default: warning
lost_tags_action()


epiverse-trace/linelist documentation built on April 16, 2024, 1:19 a.m.