ProjectMOSAIC / ggformula

Provides a formula interface to 'ggplot2' graphics.
Other
39 stars 11 forks source link

Make it easier to use arguments like shape and size in gf_dist() #74

Closed rpruim closed 6 years ago

rpruim commented 6 years ago

argument names that are simultaneously the name of a parameter for the distribution and a valid argument for a plotting function currently require the use of params = list( ) to avoid the ambiguity. But this is tricky for beginners and can lead to unexpected (and uninterpretable) plots for those who don't know or forget about this.

A new alternative removes arguments that are distribution arguments before creating the plot. These arguments can be set by prefixing with plot_. The old params = list( ) option remains.

rpruim commented 6 years ago
library(ggformula)
gf_dist("binom", size = 20, prob = 0.25, plot_size = 2)

Created on 2018-03-20 by the reprex package (v0.2.0).