Learn R Programming

tidyklips (version 0.3.0)

getwklips: `getwklips()' is used to obtain data.frame for KLIPS (career data)

Description

`getwklips()' is used to obtain data.frame for KLIPS (career data)

Usage

getwklips(
  path,
  datatype = c("stata", "spss", "sas", "xlsx"),
  klipsvars = c("jobseq", "jobtype"),
  outvars = c("jobseq", "jobtype")
)

Value

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

  • getwklips() returns an integer dataframe with two and more columns and rows for each respondent. The first column, pid, refers to the respondent id number, and the last column, year, refers to the year that the user wants to include in the dataframe.

Arguments

path

A string vector specifying folder containing KLIPS career data

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 ("jobseq", "jobtype")

outvars

A string vector specifying the variable names of converted data ("jobseq", "jobtype")

Examples

Run this code

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


Run the code above in your browser using DataLab