Closed mjskay closed 1 year ago
Thanks! Not sure what the best interface would be for this, but support()
would be a sensible place for it. I can do the implementation of this one.
Thanks!
Improved method for support()
on categorical distributions has been added (via the ggplot2 approach), the issue with sample distributions is a larger issue that I've moved to #91.
awesome thanks!
Is there / should there be a way to get the levels in the support of a categorical distribution (or in a sample from one?).
Currently
support()
does not list the levels:It would be nice to be able to get the list of unique values in the support, maybe here (perhaps in
$lim
)? That would be consistent with how ggplot uses "limits" on discrete versus continuous scales, for example. I could also see something like a "levels" field.Relatedly, if we create a
dist_sample()
on a character, factor, or ordered vector,support()
fails:Happy to submit a PR implementing the desired solution.