I am very pleased to announce the first release of the
ggforce is a general
ggplot2 extension package in the same vein as
ggalt with no overarching goal
other than to provide additional functionality to the
ggplot2 universe. The
inception and birth of ggforce was documented in a recent
post and the road to CRAN has
been long and winding, with my personal goal of the package going through
multiple iterations. At the beginning it was meant as a place where everyone
could submit extensions to. As I began working on
ggraph it became a dumping ground for
functionality that was broader than network visualization, and as I began
ggplot2 it became a testing ground for new facetting functions.
Now, as it is ready for CRAN, it does include some requests and code from other
developers, thus paying partial homage to the founding goal of the package.
This post will not go into detail with every functionality that ggforce adds to
ggforce includes a
where every feature is described along with motivation and code examples.
Below follows a description of all the major features (small utility functions are not included), grouped by the grammar they extend:
geom_arc()allows you to plot circle segments defined by center, radius, and start- and end-angle.
geom_arc_bar()is as above, except it draws a thick arc defined by an inner and outer radius. If the inner radius is zero it becomes a wedge.
geom_circle()makes it possible to draw circles based on coordinate space, that is, the radius is scaled to the coordinate system rather than absolute.
geom_segment()except it expands the line into multiple segments making it possible to draw gradients over the line.
geom_bezier()allows you to draw cubic and quadratic beziers.
geom_bspline()makes it possible to draw b-splines.
geom_sina()is a novel alternative to
geom_jitter()that was submitted to ggforce by the developers of sinaplot
scale_[x|y]_unit()provides support for the units class from the units package. It provides automatical labelling of axis with units as well as changing the units of the scale without touching the data.
facet_[grid|wrap]_paginate()allows you to split grid and wrap facetting out into multiple pages.
facet_zoom()is a third zooming alternative that provides a context overview.
While transformations are part of the
scales package rather than
their use is integral to
ggforce thus fills some gaps in this
department as well.
power_trans()lets you create any power transformation (
radial_trans()lets you translate between coordinates specified by radius and angle and coordinates specified by x and y.
trans_reverser()reverses any monotonous transformation function, making it possible to e.g. have a reversed log transformation (
reverse_trans()for reversing the identity transformation).
I have many cool ideas planned for future releases, and I hope that users will
approach me if they have some great ideas as well. If you have a burning wish
for something in the
ggplot2 ecosystem I welcome any issues and PRs on the
ggforce github repository. The
ggplot2 ecosystem is thriving though so please visit
http://www.ggplot2-exts.org and see if your idea doesn’t already exist in