The aim of 'ggplot2' is to aid in visual data investigations. This focus has led to a lack of facilities for composing specialised plots. 'ggforce' aims to be a collection of mainly new stats and geoms that fills this gap. All additional functionality is aimed to come through the official extension system so using 'ggforce' should be a stable experience.
Accelerating ggplot2
ggforce
is a package aimed at providing missing functionality to
ggplot2
through the extension system introduced with ggplot2
v2.0.0.
Broadly speaking ggplot2
has been aimed primarily at explorative data
visualization in order to investigate the data at hand, and less at
providing utilities for composing custom plots a la
D3.js. ggforce
is mainly an attempt to address
these “shortcoming” (design choices might be a better description). The
goal is to provide a repository of geoms, stats, etc. that are as well
documented and implemented as the official ones found in ggplot2
.
You can install the released version of ggforce from CRAN with:
install.packages("ggforce")
And the development version from GitHub with:
# install.packages("devtools")devtools::install_github("thomasp85/ggforce")
ggforce
is by design a collection of features with the only
commonality being their tie to the ggplot2
API. Because of this an
overview of all features would get too long for a README. The package
does contain a
vignette
where every feature is described and justified with examples and plots.
There should be a plot in the README of a visualization package though,
so without further ado:
library(ggforce)#> Loading required package: ggplot2ggplot(iris, aes(Petal.Length, Petal.Width, colour = Species)) +geom_point() +facet_zoom(x = Species == "versicolor")
linear_trans
for composing linear transformation using rotate
, stretch
,
shear
, reflect
, and translate
facet_stereo
added for creating stereographic projectionsgeom_voronoi_[tile|segment]
, geom_delaunay_[tile|segment|segment2]
, and
stat_delvor_summary
has been added for tesselation and triangulation.geom_spiro
has been added for drawing spirographsgeom_ellipse
for drawing regular and superellipsesgeom_regon
for drawing regular polygonsgeom_diagonal
, geom_diagonal_wide
and geom_parallel_sets
for drawing
parallel sets diagrams and other visualizations based on diagonals.geom_shape
for drawing polygons with rounded corners and
expanded/contracted sides. geom_shape
replaces all geom_polygon
internally.geom_bspline_closed
to draw polygons defined as b-splinesgeom_mark_[rect|circle|ellipse|hull]
to encircle a group of points and
optionally add textual annotation to itposition_jitternormal
to jitter points based on a normal distribution
(@andrewheiss)facet_[wrap|grid]_paginate
will now try to make panels on the last page the
same size as on full pages (#7)facet_zoom
now gains xlim
and ylim
arguments to control zoom range
directlyfacet_zoom
now gains zoom.data
to control which data gets plotted in which
panelplyr
, lazyeval
and dplyr
has all been removedgeom_sina
to match geom_violin
and allow for dodgingopen
/clamped
option to `geom_bsplinex
and y
values in geom_link2
(@thomasp85 and
@lepennec)stat_link
no longer replicates the group columndrop = FALSE
)stat_bezier0
and stat_bezier2
now return data in the expected formatn_pages
due to internal changes in ggplot2facet_zoom
in combination with secondary y-axis where the space for
the y-axis would become hugefacet_zoom
NA
to guides.zoom.x
and zoom.y
in theme (inherits from zoom
that inherits from
strip.background
)facet_wrap_paginate
that threw errors when using it with free
scales (#19)facet_zoom
where y-axis would be incorrectly displayed when
zooming on both axes without splitting the view (#23)facet_zoom
where scale expansion where not taken into account
when drawing the indicator area (#22)facet_zoom
that would throw errors with layers not containing
the column that is zoomed by (#21)geom_edge_bundle
has been renamed geom_bspline
and lost the tension
argument. True edge bundle functionality has been moved to ggraph
geom_bezier
for drawing quadratic and cubic beziersgeom_link
for augmented segment/path drawinggeom_sina
as an alternative to geom_violin
and geom_beeswarm
scale_[x|y]_unit
for using units vectorsfacet_[wrap|grid]_paginate
to split facetting into multiple pagesfacet_zoom
for contextual zoominggeom_arc
/ stat_arc
for drawing circle segmentsgeom_edge_bundle
/ stat_edge_bundle
for drawing edge bundles based on
control pointsgeom_arc_bar
/stat_arc_bar
/ stat_pie
for drawing arcs and wedges with
fillgeom_circle
/ stat_circle
for drawing circles with radius based on
coordinate system scalepower_trans
for creating power transformationsradial_trans
for creating transformation between radial and cartesian
coordinatestrans_reverser
for reversing a trans object