mlogit.data fails for latest version of mlogit package


#1

Hi

I cannot run the official R examples for mlogit as I get this error about not being able to find mlogit.data

I checked and I have the latest version mlogit v0.4-1 and mlogit.data is part of that package. So why doesnt it work plz?

data("TravelMode", package = "AER")
TM <- mlogit.data(TravelMode, choice = "choice", shape = "long",
alt.levels = c("air", "train", "bus", "car"))

Error in mlogit.data(TravelMode, choice = "choice", shape = "long", alt.levels = c("air", : could not find function "mlogit.data"
Traceback:


#2

Have you loaded mlogit package before using the function?

library(mlogit)
data("TravelMode", package = "AER")
TM <- mlogit.data(TravelMode, choice = "choice", shape = "long", alt.levels = c("air", "train", "bus", "car"))