Skip to content
Prev 173260 / 398506 Next

puzzled by math on date-time objects

Stavros Macrakis wrote:
median, but not quantile, seems to fail on complex:

    median(0i)
    # error, needs numeric
    quantile(0i)
    # fine

the latter is a presumably a bug, because it doesn't follow the
documentation, ?quantile:

"
     quantile(x, ...)

Arguments:

       x: numeric vectors whose sample quantiles are wanted.  Missing
          values are ignored.
"

and complex is not numeric:

    is.numeric(0i)
    # FALSE
well, in r complexes are not comparable, but they can be sorted:

    0i < 1i
    # no go
    sort(c(0i, 1i))
    # fine

vQ