as.haven: Coerce to haven / labelled objects

as.havenR Documentation

Coerce to haven / labelled objects

Description

Convert declared labelled objects to haven labelled objects

Usage

as.haven(x, ...)

Arguments

x

A declared labelled vector

...

Other arguments used by various methods

Details

This is a function that reverses the process of as.declared(), making a round trip between declared and haven_labelled_spss classes.

Value

A labelled vector of class "haven_labelled_spss".

Examples


x <- declared(
    c(1:5, -1),
    labels = c(Good = 1, Bad = 5, DK = -1),
    na_values = -1
)

x

as.haven(x)

declared documentation built on Sept. 11, 2024, 5:31 p.m.

Related to as.haven in declared...