dic_value_extract_one_var: generate key values for one variable

Description Usage Arguments Value Examples

View source: R/dic_value_extract.R

Description

generate key values for one variable

Usage

1

Arguments

x,

the varialbe

var_name,

the variable name. They two are designed to match the .x, and .y in imap

Value

a 1 x n dataframe with one key value per column

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
require(haven)
# mtcars.sas7bdat was generated from R mtcars dataset
# get file path
df <- system.file("extdata", "mtcars.sas7bdat", package = "createdictionary")
# read in data
d <- read_sas(df)
# one variable
dic_value_extract_one_var(d$mpg, "mpg")
# process the whole dataset
df %>%
read_sas() %>%
  imap_dfr( ~ dic_value_extract_one_var(.x, .y))

df <- system.file(package = "haven")
dse <- flat2file(df, "*.sas7bdat")
dse[1] %>%
  read_sas() %>%
  imap_dfr( ~ dic_value_extract_one_var(.x, .y))

LEPSNES/createdictionary documentation built on Dec. 13, 2021, 1:51 a.m.