Learn R Programming

intubate (version 1.0.0)

mlogit: Interfaces for mlogit package for data science pipelines.

Description

Interfaces to mlogit functions that can be used in a pipeline implemented by magrittr.

Usage

ntbt_mlogit(data, ...)

Arguments

data
data frame, tibble, list, ...
...
Other arguments passed to the corresponding interfaced function.

Value

Object returned by interfaced function.

Details

Interfaces call their corresponding interfaced function.

Examples

Run this code
## Not run: 
# library(intubate)
# library(magrittr)
# library(mlogit)
# 
# 
# ## ntbt_mlogit: Multinomial logit model
# data("Fishing", package = "mlogit")
# Fish <- mlogit.data(Fishing, varying = c(2:9), shape = "wide", choice = "mode")
# 
# ## Original function to interface
# mlogit(mode ~ price + catch, data = Fish)
# 
# ## The interface puts data as first parameter
# ntbt_mlogit(Fish, mode ~ price + catch)
# 
# ## so it can be used easily in a pipeline.
# Fish %>%
#   ntbt_mlogit(mode ~ price + catch)
# ## End(Not run)

Run the code above in your browser using DataLab