mutate_label: Extract attribute "map" and mutate object to be labelled

View source: R/mutate_label.R

mutate_labelR Documentation

Extract attribute "map" and mutate object to be labelled

Description

Labelled are used to get right labels when saving to spss using package haven

Usage

mutate_label(x)

Arguments

x

Vector

Value

Labelled

Examples

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

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