Can you provide a reproducible example.  See last line to every message
on r-help. When I try it it works:

> median(zoo(1:3))
2
2


On Sat, Sep 12, 2009 at 1:14 PM, Marc Chiarini <marc.chiar...@tufts.edu> wrote:
> Hello R-help community:
>
> I have what I think is a simple question that I hope someone can answer.
>  When using the median() function on any zoo object (in particular, mine is
> an irregular time series), I get the following error, which is thrown from
> .gt():
>
> Error in if (xi == xj) 0L else if (xi > xj) 1L else -1L :
>  argument is of length zero
>
> median() of course works fine on the coredata() of my zoo object, but not on
> the object itself.
>
> Is the median.default function coded incorrectly for zoo objects?  If not,
> then I don't understand why functions like mean() and sd() work correctly on
> the same zoo object, but not median().  Am I asking the right questions?
>  Thanks for any help you can offer.
>
> Regards,
> Marc

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

Reply via email to