check_attr: Check if object has attribute "map"

View source: R/check_attr.R

check_attrR Documentation

Check if object has attribute "map"

Description

Useful in mutate_if to be used with mutate_label

Usage

check_attr(x)

Arguments

x

Vector

Value

TRUE or FALSE

Examples

df <- data.frame(cars = 1:3)
attr(df$cars, "map") <-
data.frame(levels = 1:3, labels = c("Volvo", "Saab", "Opel"))
check_attr(df$cars)

swehip/shprplotfun documentation built on Oct. 21, 2022, 8:26 a.m.