knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

discrtr

CRAN status

Lifecycle: stable

GitHub Stars

GitHub search hit counter: R
GitHub search hit counter: data

GitHub issues GitHub release GitHub commit activity GitHub last commit

Package {discrtr} is a companion to the book Discrete Choice Analysis with R. It includes templates with code and data sets used in the book.

Installation

Install the released version of usethis from CRAN:

install.packages("discrtr")

Or you can install the development version of discrtr from GitHub with:

# install.packages("remotes")
remotes::install_github("paezha/discrtr")

Example

One data set included in the package relates to commuting in a university setting. Analysis of this data was reported by Whalen, Páez, and Carrasco (2012). The wide version of the data table can be loaded as follows:

library(discrtr)
data("mc_commute_wide")

This is a quick summary of the travel time variables in the table:

library(dplyr)
mc_commute_wide %>% 
  dplyr::select(starts_with("time.")) %>%
  summary()

There are four modes of transportation in this data set, but not all modes were available to every respondent, hence the NA's. A missing value for any of the time variables indicates that the mode was not part of the choice set for the corresponding traveller.



paezha/discrtr documentation built on March 1, 2023, 5:25 p.m.