Learn R Programming

⚠️There's a newer version (0.4.2) of this package.Take me there.

ggforce

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.

Installation

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")

Features

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 has a website 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: ggplot2
ggplot(iris, aes(Petal.Length, Petal.Width, colour = Species)) +
  geom_point() +
  facet_zoom(x = Species == "versicolor")

Code of Conduct

Please note that the ‘ggforce’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('ggforce')

Monthly Downloads

101,316

Version

0.3.1

License

MIT + file LICENSE

Maintainer

Thomas Pedersen

Last Published

August 20th, 2019

Functions in ggforce (0.3.1)

facet_matrix

Facet by different data columns
facet_wrap_paginate

Split facet_wrap over multiple plots
gather_set_data

Tidy data for use with geom_parallel_sets
facet_row

One-dimensional facets
facet_grid_paginate

Split facet_grid over multiple plots
facet_stereo

Create a stereogram plot
geom_arc

Arcs based on radius and radians
geom_arc_bar

Arcs and wedges as polygons
facet_zoom

Facet data for zoom with context
geom_autodensity

A distribution geoms that fills the panel and works with discrete and continuous data
geom_circle

Circles based on center and radius
geom_ellipse

Draw (super)ellipses based on the coordinate system scale
geom_diagonal

Draw horizontal diagonals
geom_diagonal_wide

Draw an area defined by an upper and lower diagonal
geom_autopoint

A point geom specialised for scatterplot matrices
geom_bezier

Create quadratic or cubic bezier curves
geom_voronoi

Voronoi tesselation and delaunay triangulation
geom_mark_ellipse

Annotate areas with ellipses
ggforce-package

ggforce: Accelerating 'ggplot2'
theme_no_axes

Theme without axes and gridlines
geom_mark_circle

Annotate areas with circles
geom_bspline_closed

Create closed b-spline shapes
geom_bspline

B-splines based on control points
interpolateDataFrame

Interpolate layer data
geom_spiro

Draw spirograms based on the radii of the different "wheels" involved
geom_shape

Draw polygons with expansion/contraction and/or rounded corners
geom_parallel_sets

Create Parallel Sets diagrams
geom_sina

Sina plot
n_pages

Determine the number of pages in a paginated facet plot
geom_regon

Draw regular polygons by specifying number of sides
linear_trans

Create a custom linear transformation
scale_unit

Position scales for units data
scale_depth

Scales for depth perception
GeomShape

ggforce extensions to ggplot2
trans_reverser

Reverse a transformation
radial_trans

Create radial data in a cartesian coordinate system
power_trans

Create a power transformation object
position_auto

Jitter based on scale types
geom_link

Link points with paths
geom_mark_hull

Annotate areas with hulls
position_jitternormal

Jitter points with normally distributed random noise
geom_mark_rect

Annotate areas with rectangles