R/check_attr.R
check_attr.Rd
Useful with dplyr::mutate_if()
dplyr::mutate_if()
check_attr(x)
Vector
TRUE or FALSE
TRUE
FALSE
df <- data.frame(cars = 1:3) attr(df$cars, "map") <- data.frame(levels = 1:3, labels = c("Volvo", "Saab", "Opel")) check_attr(df$cars) #> [1] TRUE