Description Usage Arguments Value Examples
View source: R/dic_value_extract.R
generate key values for one variable
1 | dic_value_extract_one_var(x, var_name)
|
x, |
the varialbe |
var_name, |
the variable name. They two are designed to match the .x, and .y in imap |
a 1 x n dataframe with one key value per column
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.