[ ] Deprecate fortify.lm(), fortify.glht(), fortify.confint.glht(), fortify.summary.glht() and fortify.cld(). Replace examples using broom::augment() and broom::tidy().
[ ] Deprecate fortify.<sp-object> and fortify.map() after ensuring geom_sf() supersedes geom_map().
[ ] Merge the docs of fortify() to autoplot() and autolayer(), and explain how developers of some custom objects can implements these methods so that the users can use ggplot2 to visualize the objects painlessly (#3721).
Note that this issue is not very high priority as maintaining fortify() doesn't seem a heavy burden, at least at the moment. I filed this issue just because it seems we need some place to discuss to avoid confusion. Anyway, I believe it's a right move to encourage users to use broom and sf.
(Originally commented at https://github.com/tidyverse/ggplot2/pull/3802#issuecomment-583852613)
In my understanding, there are 2 purposes of
fortify()
.For purpose 1, ggplot2 now provides 2 types of methods, both of which are becoming less important:
geom_sf()
.So, we can and should deprecate (or at least discourage) this type of usages.
On the other hand, for purpose 2, I think
fortify()
still plays a somehow important role. For example,fortify.tbl()
ensurestbl
iscollect()
ed.https://github.com/tidyverse/ggplot2/blob/0137a4d7a25f6ffa3c80cd3e9626a9b0dbc22482/R/fortify.r#L19-L24
Suggestions
I suggest
fortify.lm()
,fortify.glht()
,fortify.confint.glht()
,fortify.summary.glht()
andfortify.cld()
. Replace examples usingbroom::augment()
andbroom::tidy()
.fortify.<sp-object>
andfortify.map()
after ensuringgeom_sf()
supersedesgeom_map()
.fortify()
toautoplot()
andautolayer()
, and explain how developers of some custom objects can implements these methods so that the users can use ggplot2 to visualize the objects painlessly (#3721).Note that this issue is not very high priority as maintaining
fortify()
doesn't seem a heavy burden, at least at the moment. I filed this issue just because it seems we need some place to discuss to avoid confusion. Anyway, I believe it's a right move to encourage users to use broom and sf.