[R] Duplicated date values aren't duplicates
jim holtman
jholtman at gmail.com
Fri Jul 24 05:05:35 CEST 2009
What you are reporting is that there are two duplicated dates in your
data. 'duplicated' returns a logical vector that is TRUE for the
second and subsequent duplicates. Notice what is returned:
> x <- c(1,2,2,3,4,4,5,6,4,7,3)
> x[duplicated(x)]
[1] 2 4 4 3
>
On Thu, Jul 23, 2009 at 8:50 PM, Tim Clark<mudiver1200 at yahoo.com> wrote:
>
> Dear list,
>
> I just had a function (as.ltraj in Adehabitat) give me the following error:
>
> "Error in as.ltraj(xy, id, date = da) : non unique dates for a given burst"
>
> I checked my dates and got the following:
>
>> dupes<-mydata$DateTime[duplicated(mydata$DateTime)]
>> dupes
> [1] (07/30/02 00:00:00) (08/06/03 17:45:00)
>
> Is there a reason different dates would come up as duplicate values? I would prefer not to have to delete them if I don't have to. Any suggestions on how to get R to realize they are different?
>
> Thanks,
>
> Tim
>
>
>
> Tim Clark
> Department of Zoology
> University of Hawaii
>
> ______________________________________________
> 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.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help
mailing list