Learn R Programming

animint2 (version 2025.1.28)

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

815

Version

2025.1.28

License

GPL-3

Maintainer

Toby Hocking

Last Published

January 28th, 2025

Functions in animint2 (2025.1.28)

FluView

FluView
animintOutput

Shiny ui output function
aes_linetype_size_shape

Differentiation related aesthetics: linetype, size, shape
animint

Create an animint
aes_colour_fill_alpha

Colour related aesthetics: colour, fill and alpha
animint2dir

Compile and render an animint in a local directory.
aes_position

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

Publish a list of ggplots as interactive visualizations on a GitHub repository
aes_auto

Automatic aesthetic mapping
annotate

Create an annotation layer.
annotation_map

Annotation: maps.
animint2-gganimintproto

Base gganimintproto classes for ggplot2
checkSingleShowSelectedValue

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

Check extra_params argument for duplicates, non-named list
as.list.gganimintproto

Convert a gganimintproto object to a list
annotation_raster

Annotation: High-performance rectangular tiling.
autoplot

Create a complete ggplot appropriate to a particular data type
benchplot

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

Annotation: Custom grob.
checkPlotList

Check plot.list for errors
checkPlotForAnimintExtensions

Performs error checking on the plot for animint extensions
as_labeller

Coerce to labeller function
discrete_scale

Discrete scale constructor.
cut_interval

Cut up numeric vector into useful groups.
colsNotToCopy

Filter out columns that do not need to be copied
element_grob

Generate grid grob from theme element
draw_key

Key drawing functions
diamonds

Prices of 50,000 round cut diamonds
borders

Create a layer of map borders.
calc_element

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

Expand the plot limits with data.
coord_trans

Transformed cartesian coordinate system.
coord_polar

Polar coordinates.
checkAnimationTimeVar

Check animation variable for errors
facet

Facet specification.
economics

US economic time series.
breakpoints

The breakpointError of simulated signals
fortify.lm

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

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

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

Map projections.
fortify.map

Fortify method for map objects.
facet_wrap

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

Display contours of a 3d surface in 2d.
fortify.sp

Fortify method for classes from the sp package.
g_train_layout

Learn the layout of panels within a plot.
geom_blank

Blank, draws nothing.
geom_bin2d

Add heatmap of 2d bin counts.
geom_bar

Bars, rectangles with bases on x-axis
faithfuld

2d density estimate of Old Faithful data
element_line

Theme element: line.
coord_munch

Munch coordinates data
geom_count

Count the number of observations at each location.
geom_density

Display a smooth density estimate.
geom_abline

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

Connect observations.
geom_polygon

Polygon, a filled path.
geom_ribbon

Ribbons and area plots.
generation.loci

Evolution simulation
geom_point

Points, as for a scatterplot
element_rect

Theme element: rectangle.
annotation_logticks

Annotation: log tick marks
continuous_scale

Continuous scale constructor.
coord_cartesian

Cartesian coordinates.
element_text

Theme element: text.
facet_grid

Lay out panels in a grid.
geom_rug

Marginal rug plots.
coord_fixed

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

Flipped cartesian coordinates.
facet_null

Facet specification: a single panel.
geom_errorbarh

Horizontal error bars
geom_tallrect

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

Line segments and curves.
fortify

Fortify a model with data.
ggplotGrob

Generate a ggplot2 plot grob.
geom_label

Textual annotations.
format.gganimintproto

Format a gganimintproto object
geom_dotplot

Dot plot
geom_density_2d

Contours from a 2d density estimate.
getLayerName

Gives a unique name to each layer in saveLayer
geom_hex

Hexagon binning.
ggplot_build

Build ggplot for rendering.
geom_raster

Draw rectangles.
geom_crossbar

Vertical intervals: lines, crossbars & errorbars.
geom_violin

Violin plot.
+.gganimint

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

Add a smoothed conditional mean.
geom_spoke

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

Polygons from a reference map.
gg_dep

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

Function to process text size with different types of unit
getUniqueAxisLabels

Get unique axis labels for the plot
ggplot_gtable

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

Backquoted labeller
getLayerParams

Get all parameters for a layer
labeller

Generic labeller function for facets
ggtheme

ggplot2 themes
guide_colourbar

Continuous colour bar guide.
graphical-units

Graphical units
ggsave

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

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

colors() in Luv space.
guide_legend

Legend guide.
issueSelectorWarnings

Issue warnings for selectors
geom_freqpoly

Histograms and frequency polygons.
knit_print.animint

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

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

Save the common columns for each tsv to one chunk
geom_jitter

Points, jittered to reduce overplotting.
midwest

Midwest demographics.
limits

Generate correct scale type for specified limits
guides

Set guides for each scale.
last_plot

Retrieve the last plot to be modified or created.
gganimintproto

Create a new gganimintproto object
hmisc

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

Fuel economy data from 1999 and 2008 for 38 popular models of car
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.
layer

Create a new layer
make_text

Convenvience function for a showSelected plot label.
ggplot

Create a new ggplot plot.
intreg

Interval regression
position_jitterdodge

Adjust position by simultaneously dodging and jittering
getLegend

Function to get legend information for each scale
getLegendList

Function to get legend information from ggplot
lims

Convenience functions to set the axis limits.
position_nudge

Nudge points.
renderAnimint

Create an animint output element
is.theme

Reports whether x is a theme object
is.rgb

Check if character is an RGB hexadecimal color value
position_fill

Stack overlapping objects on top of one another.
is.rel

Reports whether x is a rel object
is.ggplot

Reports whether x is a ggplot object
rel

Relative sizing for theme elements
saveChunks

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

Terms of 11 presidents from Eisenhower to Obama.
remove_missing

Convenience function to remove missing values from a data.frame
is.Coord

Is this object a coordinate system?
mean_se

Calculate mean and standard errors on either side.
resolution

Compute the "resolution" of a data vector.
is.gganimintproto

Is an object a gganimintproto object?
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.
scale_linetype

Scale for line patterns.
scale_manual

Create your own discrete scale.
is.facet

Is this object a facetting specification?
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.
scale_alpha

Alpha scales.
stat_ecdf

Empirical Cumulative Density Function
scale_colour_gradient

Smooth gradient between two colours
scale_colour_grey

Sequential grey colour scale.
labellers

Labeller functions
labs

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

Position scale, date & date times
stat_ellipse

Plot data ellipses.
msleep

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

Environment to store meta data
scale_x_discrete

Discrete position.
merge_recurse

Merge a list of data frames.
parsePlot

Convert a ggplot to a list.
map_data

Create a data frame of map data.
margin

Define margins.
pt.to.lines

Convert pt value to lines
scale_colour_hue

Qualitative colour scale with evenly spaced hues.
print.gganimintproto

Print a gganimintproto object
position_dodge

Adjust position by dodging overlaps to the side.
position_jitter

Jitter points to avoid overplotting.
setPlotSizes

Set plot width and height for all plots
selectSSandCS

Separate .variable/.value selectors
position_identity

Don't adjust position
stat_function

Superimpose a function.
train_position

Train position scales with data
qplot

Quick plot
scale_identity

Use values without scaling.
reexports

Objects exported from other packages
transform_position

Convenience function to transform all position variables.
stat_unique

Remove duplicates.
split_recursive

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

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

Translating between qplot and lattice
should_stop

Used in examples to illustrate when errors should occur.
switch_axes

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

The zero grob draws nothing and has zero size.
txhousing

Housing sales in TX.
summary.gganimintplot

Displays a useful description of a ggplot object
stat_identity

Identity statistic.
print.animint

print animint
scale_shape

Scale for shapes, aka glyphs.
theme_update

Get, set and update themes.
toRGB

Convert R colors to RGB hexadecimal color values
theme

Set theme elements
scale_size

Scale size (area or radius).
transform_shape

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

theme for passing animint specific params
translate_qplot_ggplot

Translating between qplot and ggplot
print.gganimintplot

Draw plot on current graphics device.
scale_continuous

Continuous position scales (x & y).
scale_colour_brewer

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

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

A waiver object.
stat_qq

Calculation for quantile-quantile plot.
seals

Vector field of seal movements.
worldPop

World population by subcontinent
stat_summary_bin

Summarise y values at unique/binned x x.
update_geom_defaults

Modify geom/stat aesthetic defaults for future plots
update_gallery

Update gallery
update_labels

Update axis/legend labels
varied.chunk

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

Demographics by country from 1960 to 2012
absoluteGrob

Absolute grob
aes_all

Given a character vector, create a set of identity mappings
addShowSelectedForLegend

Add a showSelected aesthetic if legend is specified
aes

Define aesthetic mappings.
UStornadoes

Tornadoes in the United States from 1950 to 2012
aes_

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

Modify properties of an element in a theme object
addSSandCSasAesthetics

Add the showSelected/clickSelects params to the aesthetics mapping