Re: [R] Duplicate row names are not allowed

2017-05-23 Thread peter dalgaard
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  
> 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@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@cbs.dk  Priv: pda...@gmail.com

__
R-help@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.


Re: [R] Duplicate row names are not allowed

2017-05-22 Thread Jeff Newmiller
Start with the Posting Guide mentioned at the bottom of this email.  Note that 
only a very few types of attachments are permitted on this list... yours 
apparently were not. We generally find that providing a reproducible example 
that includes the data in the R code and the statements that cause difficulty 
all together [1][2][3] conveys questions with as little room for 
misunderstanding as possible.

It does seem like there is something wrong with your data import code  that is 
confusing data that belongs inside the data frame with row names. Just what the 
problem is depends on what code you used to import your data and how that data 
is stored in the file. You need to learn how to use the str function to examine 
your data, and getting us a reprex will help us help you. 

[1] 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

[2] http://adv-r.had.co.nz/Reproducibility.html

[3] https://cran.r-project.org/web/packages/reprex/index.html
-- 
Sent from my phone. Please excuse my brevity.

On May 22, 2017 12:02:46 PM PDT, ville iiskola via R-help 
 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

__
R-help@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.

[R] Duplicate row names are not allowed

2017-05-22 Thread ville iiskola via R-help
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__
R-help@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.