mlogit函数中的行名重复错误

时间:2019-09-11 15:08:30

标签: r mlogit

在mlogit软件包中设置数据帧时,我收到错误消息:

Error in `.rowNamesDF<-`(x, value = value) : 
  duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ‘1.1’, ‘10.3’, ‘18.0’, ‘18.1’, ‘19.2’, ‘21.1’, ‘22.3’, ‘25.2’, ‘26.0’, ‘27.3’, ‘28.2’, ‘29.0’, ‘3.0’, ‘4.3’, ‘46.3’, ‘47.0’, ‘49.1’, ‘5.0’, ‘50.0’, ‘51.2’, ‘52.0’, ‘53.2’, ‘54.1’, ‘55.2’, ‘56.0’, ‘56.3’, ‘57.1’, ‘58.2’, ‘59.0’, ‘59.3’, ‘60.1’, ‘61.3’, ‘62.1’, ‘67.0’, ‘70.3’, ‘71.2’, ‘72.0’, ‘9.1’ 

我正在运行的行是:

micro.dc <- mlogit.data(micro2, varying=c(11:21), shape="long", choice="Case", 
    alt.var="Point", id.var="ID")

我的第一列是“ ID”,它确实包含重复项,但是我已经在实验室中成功使用了相同的代码,并使用了类似的数据集,并且id.var =应该用于解释重复项...

我尝试了row.names(micro2) <- make.unique(row.names(micro2)),但是没有成功。

0 个答案:

没有答案