leeper / margins

An R Port of Stata's 'margins' Command
https://cloud.r-project.org/package=margins
Other
260 stars 40 forks source link

Switch all plotting to ggplot2 #111

Open leeper opened 5 years ago

leeper commented 5 years ago

Please specify whether your issue is about:

Let's get rid of base R graphics. It's much easier to customize ggplot2, so let's migrate to that instead.

vincentarelbundock commented 5 years ago

What are your backward compatibility requirements for this move?

The way ggplot2 sets styling is quite different, so the options may differ somewhat.

Also, your current strategy is to have bunch of arguments baked in cplot. Would you want to outsource some of that? For instance, if we return a ggplot object, users can easily use + xlab('whatever') or theme_dark or ggtitle, etc. That's less maintenance for your, but some users (not me) might find that less convenient.

leeper commented 5 years ago

I'd say it can be a fully rewrite (or, optionally, an entirely new function). I think it would be nice to have the plot.margins() retain some high level arguments (converted to ggplot2 args) but cplot() could go an entirely new direction. For example, it doesn't need to have themes or titles/labels built-in.

vincentarelbundock commented 5 years ago

This would be fixed by https://github.com/leeper/margins/pull/114

vincentarelbundock commented 4 years ago

PR closed. Work moved here: https://github.com/vincentarelbundock/marginsplot