Wong David
2018-Nov-30 13:31 UTC
[R] Seek help - plm package (Error message: duplicate 'row.names' are not allowed)
Dear Madam/ Sir, When I used the 'plm' package and import data into r last week, I found that everything was running smooth. However, when I used the 'plm' package today, I found the following error message:> pdata <- pdata.frame(mydata, index=c("Province","Year")) > pooling <- plm(Y~X, data=pdata,model="pooling")Error in `row.names<-.data.frame`(`*tmp*`, value = c("Anhui-2006", "Anhui-2007", : duplicate 'row.names' are not allowed In addition: Warning message: non-unique values when setting 'row.names': I did not find out the above error message when running panel data regression over one year. Moreover, I attempted to manipulate the data many times in the excel data file, for example, deleting the duplicated row, and convert the data into csv file. The r program shows the same result. Please kindly advise as this problem has bothered for the whole day. Enclosed is the data set and the respective result. Please kindly assist. Thanks and regards, David Wong -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Data analysis result - tourism eg CC excl IM (30 Nov.18).txt URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20181130/436d87bd/attachment.txt>
Jim Lemon
2018-Dec-01 09:42 UTC
[R] Seek help - plm package (Error message: duplicate 'row.names' are not allowed)
Hi david, The formatting of the data frame looks like the Province and Year columns have gotten stuck together. This probably has something to do with your Excel spreadsheet or the function that you are using to read it in. If there is are fewer column names than columns, this error is likely to happen. As your data did not get through, this is a guess, but it might help. Jim On Sat, Dec 1, 2018 at 1:15 AM Wong David <david-wong912 at hotmail.com> wrote:> > Dear Madam/ Sir, > > When I used the 'plm' package and import data into r last week, I found that everything was running smooth. However, when I used the 'plm' package today, I found the following error message: > > > pdata <- pdata.frame(mydata, index=c("Province","Year")) > > pooling <- plm(Y~X, data=pdata,model="pooling") > Error in `row.names<-.data.frame`(`*tmp*`, value = c("Anhui-2006", "Anhui-2007", : > duplicate 'row.names' are not allowed > In addition: Warning message: > non-unique values when setting 'row.names': > > I did not find out the above error message when running panel data regression over one year. Moreover, I attempted to manipulate the data many times in the excel data file, for example, deleting the duplicated row, and convert the data into csv file. The r program shows the same result. Please kindly advise as this problem has bothered for the whole day. > > Enclosed is the data set and the respective result. Please kindly assist. > > Thanks and regards, > David Wong > > ______________________________________________ > 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.