Package distrib already has a function to return the mean for each known distribution (normal, Poisson, etc.) given the parameters for the distribution. It would be convenient to have the mode as well.
Some distributions don't have a simple mode (e.g., a uniform distribution), or have multiple modes (e.g., binomial for some choices of parameters). Not sure what to do in those cases.
Perhaps it would be good enough to define a mode function just for the PDFs that have a single value. Or maybe if there are a finite number of values, just return a list of the values. Perhaps the uniform pdf can just signal an error?
Yeah, if a single number, return that, if a list, return the list, if not a finite list, then report an error -- that all makes sense to me.