# Using data read from disk
data_path <- covid_example(path="exampledata.csv")
dictionary.path <- covid_example(path="dictionaryexample.xls")
deflator.path <- covid_example(path="deflatorexample.xls")
covid.df <- read_covid(microdata=data_path, vars=c("C001","C002"))
covid.df <- covid_labeller(data_covid=covid.df, dictionary.file=dictionary.path)
covid.df <- covid_deflator(data_covid=covid.df, deflator.file=deflator.path)
# \donttest{
covid.svy <- covid_design(data_covid=covid.df)
# Calculating proportion of people temporarily away from work
if (!is.null(covid.svy)) survey::svymean(x=~C002, design=covid.svy, na.rm=TRUE)# }
# \donttest{
# Downloading data
covid.df2 <- get_covid(year=2020, month=5, vars=c("C001","C002"),
labels=TRUE, deflator=TRUE, design=FALSE,
reload=TRUE, curlopts=list(), savedir=tempdir())
covid.svy2 <- covid_design(data_covid=covid.df2)
# Calculating proportion of people temporarily away from work
if (!is.null(covid.svy2)) survey::svymean(x=~C002, design=covid.svy2, na.rm=TRUE)# }
Run the code above in your browser using DataLab