View source: R/get_data_from_web.R
downloads CPS data from web
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | get_data_from_web(
startingdate = as.Date("20050101", "%Y%m%d"),
enddate = startingdate,
varlist = tolower(c("pulineno", "pwsswgt", "hrhhid", "hrlongid", "hrhhid2", "cpsid",
"pwcmpwgt", "hwniwgt", "PUMLR", "Pemlr", "PEHSPNON", "prtage", "peage", "PESEX",
"GESTFIPS", "puhhmem", "prpertyp", "PTDTRACE", "prwtrace", "PRBLNONB", "GESTREC",
"hrintsta", "hrmis")),
col_types = list(pulineno = col_character(), pwsswgt = col_double(), hrhhid =
col_character(), hrlongid = col_character(), hrhhid2 = col_character(), cpsid =
col_character(), pwcmpwgt = col_double(), hwniwgt = col_double(), pumlr =
col_character(), pemlr = col_character(), pehspnon = col_character(), prtage =
col_double(), peage = col_integer(), pesex = col_character(), gestfips =
col_character(), puhhmem = col_character(), prpertyp = col_character(), ptdtrace =
col_character(), prwtrace = col_character(), prblnonb = col_character(), gestrec
= col_character(), hrintsta = col_character(), hrmis = col_character()),
directory = NULL,
createdatabase = FALSE,
createrdafiles = FALSE,
returnvalue = TRUE,
cps.dbname = "cps.db"
)
|
varlist |
a vector of character strings, the variables to keep from the downloaded file |
directory |
where to save the file |
createdatabase |
a boolean(default FALSE), |
createrdafiles |
a boolean(default FALSE), |
returnvalue |
a boolean |
endgdate |
a date (default: |
coltypes |
a vector of character strings, the variables to keep from the downloaded file |
cps.dbname="cps.db" |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.