haven_all_levels {REDCapCAST}R Documentation

Finish incomplete haven attributes substituting missings with values

Description

Finish incomplete haven attributes substituting missings with values

Usage

haven_all_levels(data)

Arguments

data

haven labelled variable

Value

named vector

Examples

ds <- structure(c(1, 2, 3, 2, 10, 9),
  labels = c(Unknown = 9, Refused = 10),
  class = "haven_labelled"
)
haven::is.labelled(ds)
attributes(ds)
ds |> haven_all_levels()

[Package REDCapCAST version 25.3.2 Index]