I ran into a bit of unexpected behavior when making some updates to ggdist. Currently without an implementation of median.dist_default() you can get some errors when trying to get medians of slices of distributions:
> x = dist_normal(1,1)
> median(x)
[1] 1
> x[[1]]
N(1, 1)
> median(x[[1]])
Error in rank(x, ties.method = "min", na.last = "keep") :
unimplemented type 'list' in 'greater'
This PR adds an implementation of median.dist_default() that simply copies the implementation of median.distribution() so that the following works:
I ran into a bit of unexpected behavior when making some updates to ggdist. Currently without an implementation of
median.dist_default()
you can get some errors when trying to get medians of slices of distributions:This PR adds an implementation of
median.dist_default()
that simply copies the implementation ofmedian.distribution()
so that the following works:Happy to adjust as needed.