getaklips {tidyklips}R Documentation

‘getaklips()’ is used to obtain data.frame for KLIPS (additional survey)

Description

‘getaklips()’ is used to obtain data.frame for KLIPS (additional survey)

Usage

getaklips(
  path,
  year,
  datatype = c("stata", "spss", "sas", "xlsx"),
  klipsvars = c("6101", "6102"),
  outvars = c("activity", "howmayactivity")
)

Arguments

path

A string vector specifying folder containing KLIPS additional survey data

year

an integer vector specifying the years from 1998 to 2023 that the user wants to include in the dataframe.

datatype

A string vector specifying the format of the raw data you want to convert to a data frame ("spss", "sas", "stata", "excel")

klipsvars

A string vector specifying the variables in the raw data that you want to convert to a data frame ("6101", "6102")

outvars

A string vector specifying the variable names of converted data ("acivity", "howmayactivity")

Value

A data frame containing klips household member data with the specified years and variables.

Examples


path <- system.file("extdata", package = "tidyklips")
df <- getaklips(path = path, year = 2023, datatype = "stata")
df %>%
  dplyr::group_by(year, activity) %>%
  dplyr::summarise(count = dplyr::n()) %>%
  dplyr::mutate(proportion = count / sum(count))



[Package tidyklips version 0.3.0 Index]