[R] Finding Source of Error Message of 'Non-Unique Index Entries'

David Winsemius dwinsemius at comcast.net
Wed Jan 4 19:07:11 CET 2012


On Jan 4, 2012, at 12:21 PM, Rich Shepard wrote:

> On Tue, 3 Jan 2012, David Winsemius wrote:
>
>> burns.tds[ !duplicated(burns.tds) ,  ]
>
>  Apparently it does not matter if the site column in the data frame  
> is a
> factor or a character, read.zoo() generates the same error. Applying  
> the
> above produces a long list starting with:
>
> burns.tds[!duplicated(burns.tds), ]
>        site   sampdate    quant
> 599     BC-3 1992-03-27    0.100
> 600     BC-3 1992-04-30    0.100
> 601     BC-3 1992-05-30    0.100
> 603     BC-3 1992-06-19    0.100
> 1214    BC-3 1992-07-20    0.100
> 1215    BC-3 1992-08-10    0.100
> 1216    BC-3 1992-09-30    0.100
> 1217    BC-3 1992-10-29    0.100
> 1218    BC-3 1992-11-19    0.100
> 1929    BC-3 1995-03-23    8.080
>
>  I don't know how to interpret this. I don't see two rows with the  
> same
> values, but ~ 500 rows each with a different value. What is  
> duplicated? The
> entire row? The site ID?

You didn't ask for what was duplicated, but rather what was NOT  
duplicated with that code. In the case of a dataframe it is the entire  
row that is tested.

>
>  ?duplicated has some examples, but those do not show the output of  
> the
> function nor explain what's duplicated.
>
>  I need to get past this blockage and appreciate your help in  
> determining
> why read.zoo() sees duplicates when the database table has none, and  
> how to
> resolve this issue.

I think you need to reduce this problem to a dataframe that you either  
post an access method for or use dput() to include. Then you need to  
say what you goals are and what code is not working on that example.


> TIA,
>
> Rich
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list