View source: R/fun_data_import.r
fun_data_import | R Documentation |
Only import data from MICS. Not for genderal use
fun_data_import(
country = "Pakistan",
dataset = "hl",
var_id = c("HH1", "HH2", "HL1"),
var_interested_identify = c("disability", "wscore", "windex5r"),
var_interested_match = c("ST3$", "TS5B", "TS6"),
var_sampling_weight = "hhweight",
level = 1
)
country |
which country's data to be imported |
dataset |
which data set need to be imported. Options include "hl", "ch", "fs", "wm", "mn", "hh", and others |
var_id |
which variables use to generate unique id. hh is c("HH1", "HH2"), others more likely is c("HH1", "HH2", "HL1") |
var_interested_identify |
identify names of variables. For example, for variable "gender", you need input "gender" |
var_interested_match |
match the variables by start_with. for example, for series of variables "FCF1", "FCF2", "FCF3", FCF4", you can easily input "FCF". Then the function will extract all the variables start with "FCF" |
var_sampling_weight |
sampling weight |
Shanquan CHEN shanquan0301@gmial.com
# import from hl
dat_hl <- lapply(country_name, FUN = fun_data_import,
dataset = "hl",
var_id = c("HH1", "HH2", "HL1"),
var_interested_identify = c("HL4", "HL6", "HH6", "ED2A", "melevel", "caretakerdis"),
var_interested_match = c("HL5", "HT12", "windex5", "windex10", "disability"),
var_sampling_weight = "hhweight")
dat_hl <- do.call("bind_rows", dat_hl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.