R/funpark_data.R

#' alphabets
#'
#' Collection of all English alphabets, both lowercases and uppercases.
#'
#' @docType data
#' @usage data(alphabets)
#' @format A data.frame with 26 rows and 2 variables:
#' \describe{
#'     \item{upper}{<chr> uppercase letters}
#'     \item{lower}{<chr> lowercase letters}
#' }
#' @keywords datasets
#' @examples
#' data(alphabets)
#' all_alphabets <- sort(c(alphabets$upper, alphabets$lower))
"alphabets"



#' rich dataset
#'
#' A sample dataset to test functions. This dataset has a binary response.
#'
#' @docType data
#' @usage data(rich)
#' @format A data.table with 10 rows and 3 variables:
#' \describe{
#'     \item{gender}{gender, either \code{M}ale or \code{F}emale}
#'     \item{criminal_record}{indicating whether a person has a criminal record (\code{yes}) or not (\code{no})}
#'     \item{is_rich}{integer column, \code{0} if not rich and \code{1} if rich}
#' }
#' @keywords datasets
#' @examples
#' data(rich)
#' change_form(
#'     rich,
#'     from = 'binary', to = 'binomial',
#'     old_response = 'is_rich',
#'     new_response = c('rich', 'not_rich')
#' )
"rich"



#' rich_binom dataset
#'
#' A sample dataset to test functions. This dataset has binomial responses.
#'
#' @docType data
#' @usage data(rich_binom)
#' @format A data.table with 4 rows and 4 variables:
#' \describe{
#'     \item{gender}{gender, either \code{M}ale or \code{F}emale}
#'     \item{criminal_record}{indicating whether a person has a criminal record (\code{yes}) or not (\code{no})}
#'     \item{rich}{the number of rich people that satisfies \code{(gender, criminal_record)} combination}
#'     \item{not_rich}{the number of non-rich people that satisfies the same combination as in \code{rich}}
#' }
#' @keywords datasets
#' @examples
#' data(rich_binom)
#' binarize_binom(rich_binom, c('rich', 'not_rich'), 'is_rich')
"rich_binom"



#' rich_pois dataset
#'
#' A sample dataset to test functions. This dataset has a count response.
#'
#' @docType data
#' @usage data(rich_pois)
#' @format A data.table with 8 rows and 4 variables:
#' \describe{
#'     \item{gender}{gender, either \code{M}ale or \code{F}emale}
#'     \item{criminal_record}{indicating whether a person has a criminal record (\code{yes}) or not (\code{no})}
#'     \item{is_rich}{factors, \code{rich} if a person is rich and \code{not_rich} otherwise}
#'     \item{count}{the number of people that satisfies \code{(gender, criminal_record, is_rich)} combination}
#' }
#' @keywords datasets
#' @examples
#' data(rich_pois)
#' binarize_pois(rich_pois, 'count')
"rich_pois"
joon3216/funpark documentation built on June 18, 2019, 7:32 a.m.