vartab: Recreate Stata's variable table

View source: R/stata-helpers.R

vartabR Documentation

Recreate Stata's variable table

Description

Recreate Stata's variable table

Usage

vartab(dta, string = NULL, name = alias)

Arguments

dta

output from read_dta

string

string to search and filter, optional

name

Name of the variable for the column of original stata variables

Examples

# example data (what a read_dta tbl would look like)
df <- tibble(id = 1:3, pid = 1:3, age = 1:3)
attr(df[["id"]], "label") <- "Case Identifier"
attr(df[["pid"]], "label") <- "Partisan Identity"

vartab(df)
vartab(df, "identity")

kuriwaki/rcces documentation built on Sept. 12, 2023, 5:31 p.m.