These functions assign or retrieve a "show_only" attribute for a vector (typically a column in a dataframe). The attribute specifies which levels should be displayed while keeping the full dataset intact.
Value
For set_show_only, the modified vector with the "show_only"
attribute set. For get_show_only, the "show_only" attribute value.
Examples
library(dplyr)
example_df <- data.frame(region = c("North", "South", "East", "West"))
get_show_only(example_df$region) # Returns: NULL
#> NULL
example_df <- example_df %>%
mutate(region = set_show_only(region, c("North", "South")))
get_show_only(example_df$region) # Returns: "North" "South"
#> [1] "North" "South"