[R] Duplicate row names are not allowed

peter dalgaard pdalgd at gmail.com
Tue May 23 11:22:14 CEST 2017


Presumably, RCommander's readXL generates an invalid data frame (John?). To investigate, look at

row.names(Dataset)

and to fix 

row.names(Dataset) <- NULL

If the issue is that Dataset really isn't a data frame, maybe try Dataset <- as.data.frame(Dataset).

[Your screenshot made it through to here, but not the data. Notice, as a general matter, that it is preferable to give your code as part of the message text; it is hard to copy-paste from a .png]

-pd

> On 22 May 2017, at 21:02 , ville iiskola via R-help <r-help at r-project.org> wrote:
> 
> Hi
> I read a book where was shown an example how to create a probability model with mlogit. I tried to do like the instruction said but i get error message that "duplicate row names are not allowed". What could i do to fix it?
> 
> I had the data in excel and imported it to R using R commander. I attach the data file and print sqreen of my code to here if somebody could help the novice. Ville<2017-05-21 (1).png>______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list