I am learning how to use mlogit package. These are some lines that appear as an example in a vignette of the package:
data("Heating", package = "mlogit")
H <- dfidx(Heating, choice = "depvar", varying = c(3:12))
However, when I want to view df H, I keep getting the same error: r error 4 (R code execution error)
This is the error that appears in the console:
Error in
[.data.frame
(x, start:min(NROW(x), start + len)) : undefined columns selected
The funny thing is that if a restart R, I can view the df. It seems that the problem is created when I want to use the package mlogit.
Any hint what could be going on?