Learn R Programming

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

animint2 (version 2023.6.11)

Animated Interactive Grammar of Graphics

Description

Functions are provided for defining animated, interactive data visualizations in R code, and rendering on a web page. The 2018 Journal of Computational and Graphical Statistics paper, describes the concepts implemented.

Copy Link

Version

Install

install.packages('animint2')

Monthly Downloads

705

Version

2023.6.11

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Toby Hocking

Last Published

June 14th, 2023

Functions in animint2 (2023.6.11)

aes_linetype_size_shape

Differentiation related aesthetics: linetype, size, shape
annotate

Create an annotation layer.
animint2gist

Convert a list of ggplots to an interactive animation and post files as a gist
aes_position

Position related aesthetics: x, y, xmin, xmax, ymin, ymax, xend, yend
animint

Create an animint
aes_auto

Automatic aesthetic mapping
animint2dir

Compile and render an animint in a local directory.
aes_colour_fill_alpha

Colour related aesthetics: colour, fill and alpha
animintOutput

Shiny ui output function
annotation_map

Annotation: maps.
annotation_raster

Annotation: High-performance rectangular tiling.
checkExtraParams

Check extra_params argument for duplicates, non-named list
checkForSSandCSasAesthetics

Check if showSelected and clickSelects have been used as aesthetics as in old syntax. If yes, raise error
animint2-gganimintproto

Base gganimintproto classes for ggplot2
annotation_logticks

Annotation: log tick marks
annotation_custom

Annotation: Custom grob.
calc_element

Calculate the element properties, by inheriting properties from its parents
coord_cartesian

Cartesian coordinates.
continuous_scale

Continuous scale constructor.
cut_interval

Cut up numeric vector into useful groups.
as.list.gganimintproto

Convert a gganimintproto object to a list
as_labeller

Coerce to labeller function
checkPlotList

Check plot.list for errors
checkPlotForAnimintExtensions

Performs error checking on the plot for animint extensions
diamonds

Prices of 50,000 round cut diamonds
autoplot

Create a complete ggplot appropriate to a particular data type
borders

Create a layer of map borders.
element_grob

Generate grid grob from theme element
benchplot

Benchmark plot creation time. Broken down into construct, build, render and draw times.
coord_map

Map projections.
coord_fixed

Cartesian coordinates with fixed relationship between x and y scales.
discrete_scale

Discrete scale constructor.
generation.loci

Evolution simulation
coord_flip

Flipped cartesian coordinates.
checkAnimationTimeVar

Check animation variable for errors
checkSingleShowSelectedValue

Issue warnings for non interactive plots where there is only one showSelected value
breakpoints

The breakpointError of simulated signals
geom_abline

Lines: horizontal, vertical, and specified by slope and intercept.
draw_key

Key drawing functions
economics

US economic time series.
coord_polar

Polar coordinates.
colsNotToCopy

Filter out columns that do not need to be copied
geom_count

Count the number of observations at each location.
geom_density

Display a smooth density estimate.
faithfuld

2d density estimate of Old Faithful data
element_rect

Theme element: rectangle.
element_text

Theme element: text.
element_line

Theme element: line.
facet_wrap

Wrap a 1d ribbon of panels into 2d.
expand_limits

Expand the plot limits with data.
coord_munch

Munch coordinates data
format.gganimintproto

Format a gganimintproto object
element_blank

Theme element: blank. This theme element draws nothing, and assigns no space
fortify

Fortify a model with data.
geom_blank

Blank, draws nothing.
geom_map

Polygons from a reference map.
geom_crossbar

Vertical intervals: lines, crossbars & errorbars.
facet

Facet specification.
fortify.sp

Fortify method for classes from the sp package.
g_train_layout

Learn the layout of panels within a plot.
geom_polygon

Polygon, a filled path.
geom_ribbon

Ribbons and area plots.
geom_contour

Display contours of a 3d surface in 2d.
facet_null

Facet specification: a single panel.
facet_grid

Lay out panels in a grid.
fortify.map

Fortify method for map objects.
coord_trans

Transformed cartesian coordinate system.
fortify.lm

Supplement the data fitted to a linear model with model fit statistics.
geom_errorbarh

Horizontal error bars
geom_jitter

Points, jittered to reduce overplotting.
geom_hex

Hexagon binning.
geom_freqpoly

Histograms and frequency polygons.
geom_bin2d

Add heatmap of 2d bin counts.
geom_bar

Bars, rectangles with bases on x-axis
geom_density_2d

Contours from a 2d density estimate.
geom_rug

Marginal rug plots.
geom_dotplot

Dot plot
geom_path

Connect observations.
geom_widerect

ggplot2 geom with ymin and ymax aesthetics that covers the entire x range, useful for clickSelects background elements.
geom_segment

Line segments and curves.
geom_raster

Draw rectangles.
geom_violin

Violin plot.
ggsave

Save a ggplot (or other grid object) with sensible defaults
getCommonChunk

Save the common columns for each tsv to one chunk
ggplotGrob

Generate a ggplot2 plot grob.
ggplot_build

Build ggplot for rendering.
ggplot_gtable

Build a plot with all the usual bits and pieces.
geom_tallrect

ggplot2 geom with xmin and xmax aesthetics that covers the entire y range, useful for clickSelects background elements.
gganimintproto

Create a new gganimintproto object
is.rgb

Check if character is an RGB hexadecimal color value
ggplot

Create a new ggplot plot.
geom_spoke

A line segment parameterised by location, direction and distance.
geom_smooth

Add a smoothed conditional mean.
is.rel

Reports whether x is a rel object
is.ggplot

Reports whether x is a ggplot object
geom_point

Points, as for a scatterplot
getLayerName

Gives a unique name to each layer in saveLayer
is.facet

Is this object a facetting specification?
getUniqueAxisLabels

Get unique axis labels for the plot
hmisc

Wrap up a selection of summary functions from Hmisc to make it easy to use with stat_summary.
getTextSize

Function to process text size with different types of unit
getLayerParams

Get all parameters for a layer
guides

Set guides for each scale.
labs

Change axis labels, legend titles, plot title/subtitle and below-plot caption.
is.theme

Reports whether x is a theme object
labellers

Labeller functions
midwest

Midwest demographics.
is.gganimintproto

Is an object a gganimintproto object?
make_bar

Convenience function for an interactive bar that might otherwise be created using stat_summary(geom="bar").
merge_recurse

Merge a list of data frames.
mean_se

Calculate mean and standard errors on either side.
luv_colours

colors() in Luv space.
mpg

Fuel economy data from 1999 and 2008 for 38 popular models of car
position_identity

Don't adjust position
ggtheme

ggplot2 themes
+.gganimint

Add a new component to a ggplot or theme object.
geom_label

Textual annotations.
presidential

Terms of 11 presidents from Eisenhower to Obama.
saveChunks

Split data set into chunks and save them to separate files.
scale_alpha

Alpha scales.
position_fill

Stack overlapping objects on top of one another.
resolution

Compute the "resolution" of a data vector.
renderAnimint

Create an animint output element
position_jitter

Jitter points to avoid overplotting.
label_bquote

Backquoted labeller
graphical-units

Graphical units
labeller

Generic labeller function for facets
lims

Convenience functions to set the axis limits.
issueSelectorWarnings

Issue warnings for selectors
knit_print.animint

Insert an interactive animation into an R markdown document using a customized print method.
scale_continuous

Continuous position scales (x & y).
setPlotSizes

Set plot width and height for all plots
gg_dep

Give a deprecation error, warning, or message, depending on version number.
msleep

An updated and expanded version of the mammals sleep dataset.
scale_colour_brewer

Sequential, diverging and qualitative colour scales from colorbrewer.org
last_plot

Retrieve the last plot to be modified or created.
scale_colour_gradient

Smooth gradient between two colours
selectSSandCS

Separate .variable/.value selectors
is.Coord

Is this object a coordinate system?
intreg

Interval regression
limits

Generate correct scale type for specified limits
qplot

Quick plot
layer

Create a new layer
position_nudge

Nudge points.
newEnvironment

Environment to store meta data
pt.to.lines

Convert pt value to lines
position_jitterdodge

Adjust position by simultaneously dodging and jittering
reexports

Objects exported from other packages
print.gganimintproto

Print a gganimintproto object
switch_axes

Flip axes in case of coord_flip Switches column names. Eg. xmin to ymin, yntercept to xintercept etc.
summary.gganimintplot

Displays a useful description of a ggplot object
scale_colour_grey

Sequential grey colour scale.
scale_size_animint

Scale point sizes using circle area, but specifying the radius in pixels.
getLegend

Function to get legend information for each scale
scale_linetype

Scale for line patterns.
guide_colourbar

Continuous colour bar guide.
getLegendList

Function to get legend information from ggplot
seals

Vector field of seal movements.
scale_manual

Create your own discrete scale.
theme

Set theme elements
theme_update

Get, set and update themes.
scale_shape

Scale for shapes, aka glyphs.
scale_size

Scale size (area or radius).
stat_identity

Identity statistic.
stat_function

Superimpose a function.
scale_x_discrete

Discrete position.
scale_date

Position scale, date & date times
toRGB

Convert R colors to RGB hexadecimal color values
make_tallrect

Make a clickSelects geom_tallrect that completely tiles the x range. This makes it easy to construct tallrects for the common case of selecting a particular x value.
make_tallrect_or_widerect

Make a clickSelects geom_widerect or geom_tallrect that completely tiles the x or y range. This function is used internally by make_tallrect or make_widerect, which are more user-friendly.
guide_legend

Legend guide.
make_widerect

Make a clickSelects geom_widerect that completely tiles the y range. This makes it easy to construct widerects for the common case of selecting a particular y value.
make_text

Convenvience function for a showSelected plot label.
train_position

Train position scales with data
worldPop

World population by subcontinent
zeroGrob

The zero grob draws nothing and has zero size.
transform_position

Convenience function to transform all position variables.
theme_animint

theme for passing animint specific params
update_geom_defaults

Modify geom/stat aesthetic defaults for future plots
update_labels

Update axis/legend labels
parsePlot

Convert a ggplot to a list.
map_data

Create a data frame of map data.
print.animint

print animint
margin

Define margins.
print.gganimintplot

Draw plot on current graphics device.
scale_identity

Use values without scaling.
stat_ecdf

Empirical Cumulative Density Function
scale_colour_hue

Qualitative colour scale with evenly spaced hues.
position_dodge

Adjust position by dodging overlaps to the side.
stat_summary_2d

Bin and summarise in 2d (rectangle & hexagons)
stat_ellipse

Plot data ellipses.
split_recursive

Split data.frame into recursive list of data.frame.
stat_summary_bin

Summarise y values at unique/binned x x.
remove_missing

Convenience function to remove missing values from a data.frame
stat_qq

Calculation for quantile-quantile plot.
rel

Relative sizing for theme elements
stat_unique

Remove duplicates.
translate_qplot_ggplot

Translating between qplot and ggplot
transform_shape

Function to transform R shapes into d3 shapes...
should_stop

Used in examples to illustrate when errors should occur.
translate_qplot_lattice

Translating between qplot and lattice
varied.chunk

Extract subset for each data.frame in a list of data.frame
txhousing

Housing sales in TX.
waiver

A waiver object.
aes_

Define aesthetic mappings from strings, or quoted calls and formulas.
addShowSelectedForLegend

Add a showSelected aesthetic if legend is specified
absoluteGrob

Absolute grob
aes

Define aesthetic mappings.
addSSandCSasAesthetics

Add the showSelected/clickSelects params to the aesthetics mapping
WorldBank

Demographics by country from 1960 to 2012
UStornadoes

Tornadoes in the United States from 1950 to 2012
add_theme

Modify properties of an element in a theme object
FluView

FluView
aes_all

Given a character vector, create a set of identity mappings