Package: animint2 2024.9.17

Toby Hocking

animint2: Animated Interactive Grammar of Graphics

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, <doi:10.1080/10618600.2018.1513367> describes the concepts implemented.

Authors:Toby Hocking [aut, cre], Hadley Wickham [aut], Winston Chang [aut], RStudio [cph], Nicholas Lewin-Koh [aut], Martin Maechler [aut], Randall Prium [aut], Susan VanderPlas [aut], Carson Sievert [aut], Kevin Ferris [aut], Jun Cai [aut], Faizan Khan [aut], Vivek Kumar [aut], Himanshu Singh [aut], Yufan Fei [aut], Jocelyne Chen [aut], Siddhesh Deodhar [aut]

animint2_2024.9.17.tar.gz
animint2_2024.9.17.zip(r-4.5)animint2_2024.9.17.zip(r-4.4)animint2_2024.9.17.zip(r-4.3)
animint2_2024.9.17.tgz(r-4.4-any)animint2_2024.9.17.tgz(r-4.3-any)
animint2_2024.9.17.tar.gz(r-4.5-noble)animint2_2024.9.17.tar.gz(r-4.4-noble)
animint2_2024.9.17.tgz(r-4.4-emscripten)animint2_2024.9.17.tgz(r-4.3-emscripten)
animint2.pdf |animint2.html
animint2/json (API)
NEWS

# Install 'animint2' in R:
install.packages('animint2', repos = c('https://animint.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/animint/animint2/issues

Datasets:
  • ChromHMMiterations - ChromHMM iterations
  • FluView - FluView
  • FunctionalPruning - Functional Pruning Algorithm
  • PeakConsistency - Consistency of segmentation models in simulated Poisson peaks
  • TestROC - Test ROC curves
  • UStornadoes - Tornadoes in the United States from 1950 to 2012
  • VariantModels - Error rates of supervised learning methods for variant calling
  • WorldBank - Demographics by country from 1960 to 2012
  • breakpoints - The breakpointError of simulated signals
  • change - Graphical model structure change
  • climate - Climate data in central America from 1995 to 2000
  • compare - Testing rank and compare SVM on simulated patterns
  • diamonds - Prices of 50,000 round cut diamonds
  • economics - US economic time series.
  • economics_long - US economic time series.
  • faithfuld - 2d density estimate of Old Faithful data
  • generation.loci - Evolution simulation
  • intreg - Interval regression
  • luv_colours - 'colors()' in Luv space.
  • malaria - Malaria parasite genome variants
  • midwest - Midwest demographics.
  • mixtureKNN - K-Nearest-Neighbors model of the mixture example data
  • montreal.bikes - Montreal bikes
  • mpg - Fuel economy data from 1999 and 2008 for 38 popular models of car
  • msleep - An updated and expanded version of the mammals sleep dataset.
  • pirates - Worldwide pirate attacks from 1978 to 2013
  • presidential - Terms of 11 presidents from Eisenhower to Obama.
  • prior - Class prior change
  • prostateLasso - Lasso model of the prostate cancer data set
  • seals - Vector field of seal movements.
  • txhousing - Housing sales in TX.
  • vervet - Vervet monkey intestinal microbiome
  • worldPop - World population by subcontinent

On CRAN:

390 exports 60 stars 3.77 score 36 dependencies 174 scripts 579 downloads

Last updated 12 hours agofrom:70bb33b294. Checks:OK: 1 ERROR: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 17 2024
R-4.5-winERRORSep 17 2024
R-4.5-linuxERRORSep 17 2024
R-4.4-winERRORSep 17 2024
R-4.4-macERRORSep 17 2024
R-4.3-winERRORSep 17 2024
R-4.3-macERRORSep 17 2024

Exports:.pt.stroke%+%%+replace%a_scales_listaesaes_aes_allaes_autoaes_qaes_stringalphaanimintanimint2diranimint2pagesanimintOutputannotateannotation_customannotation_logticksannotation_mapannotation_rasterarrowas_labellerautoplotbenchplotborderscalc_elementcontinuous_scaleCoordcoord_cartesiancoord_equalcoord_fixedcoord_flipcoord_mapcoord_munchcoord_polarcoord_quickmapcoord_transCoordCartesianCoordFixedCoordFlipCoordMapCoordPolarCoordQuickmapCoordTranscut_intervalcut_numbercut_widthdiscrete_scaledraw_key_ablinedraw_key_blankdraw_key_crossbardraw_key_dotplotdraw_key_labeldraw_key_pathdraw_key_pointdraw_key_pointrangedraw_key_polygondraw_key_rectdraw_key_smoothdraw_key_textdraw_key_vlinedraw_key_vpathelement_blankelement_grobelement_lineelement_rectelement_textexpand_limitsfacetfacet_gridfacet_nullfacet_wrapfortifyGeomgeom_ablinegeom_areageom_bargeom_bin2dgeom_blankgeom_contourgeom_countgeom_crossbargeom_curvegeom_densitygeom_density_2dgeom_density2dgeom_dotplotgeom_errorbargeom_errorbarhgeom_freqpolygeom_hexgeom_histogramgeom_hlinegeom_jittergeom_labelgeom_linegeom_linerangegeom_mapgeom_pathgeom_pointgeom_pointrangegeom_polygongeom_qqgeom_rastergeom_rectgeom_ribbongeom_ruggeom_segmentgeom_smoothgeom_spokegeom_stepgeom_tallrectgeom_textgeom_tilegeom_violingeom_vlinegeom_widerectGeomAblineGeomAnnotationMapGeomAreaGeomBarGeomBin2dGeomBlankGeomContourGeomCrossbarGeomCurveGeomCustomAnnGeomDensityGeomDensity2dGeomDotplotGeomErrorbarGeomErrorbarhGeomFreqpolyGeomHexGeomHlineGeomLabelGeomLineGeomLinerangeGeomLogticksGeomMapGeomPathGeomPointGeomPointrangeGeomPolygonGeomRasterGeomRasterAnnGeomRectGeomRibbonGeomRugGeomSegmentGeomSmoothGeomSpokeGeomStepGeomTallRectGeomTextGeomTileGeomViolinGeomVlineGeomWideRectgetLegendListgg_depgganimintprotogganimintproto_parentggplotggplot_buildggplot_gtableggplotGrobggsaveggtitleguide_colorbarguide_colourbarguide_legendguidesis.Coordis.facetis.gganimintprotois.ggplotis.rgbis.themelabel_bothlabel_bquotelabel_contextlabel_parsedlabel_valuelabel_wrap_genlabellerlabslast_plotlayerlayer_datalayer_groblayer_scaleslimsmake_barmake_tallrectmake_tallrect_or_widerectmake_textmake_widerectmap_datamarginmean_cl_bootmean_cl_normalmean_sdlmean_semedian_hilowparsePlotPositionposition_dodgeposition_fillposition_identityposition_jitterposition_jitterdodgeposition_nudgeposition_stackPositionDodgePositionFillPositionIdentityPositionJitterPositionJitterdodgePositionNudgePositionStackqplotquickplotrelremove_missingrenderAnimintresolutionScalescale_alphascale_alpha_continuousscale_alpha_discretescale_alpha_identityscale_alpha_manualscale_color_brewerscale_color_continuousscale_color_discretescale_color_distillerscale_color_gradientscale_color_gradient2scale_color_gradientnscale_color_greyscale_color_huescale_color_identityscale_color_manualscale_colour_brewerscale_colour_continuousscale_colour_datescale_colour_datetimescale_colour_discretescale_colour_distillerscale_colour_gradientscale_colour_gradient2scale_colour_gradientnscale_colour_greyscale_colour_huescale_colour_identityscale_colour_manualscale_fill_brewerscale_fill_continuousscale_fill_datescale_fill_datetimescale_fill_discretescale_fill_distillerscale_fill_gradientscale_fill_gradient2scale_fill_gradientnscale_fill_greyscale_fill_huescale_fill_identityscale_fill_manualscale_linetypescale_linetype_continuousscale_linetype_discretescale_linetype_identityscale_linetype_manualscale_radiusscale_shapescale_shape_continuousscale_shape_discretescale_shape_identityscale_shape_manualscale_sizescale_size_animintscale_size_areascale_size_continuousscale_size_datescale_size_datetimescale_size_discretescale_size_identityscale_size_manualscale_x_continuousscale_x_datescale_x_datetimescale_x_discretescale_x_log10scale_x_reversescale_x_sqrtscale_y_continuousscale_y_datescale_y_datetimescale_y_discretescale_y_log10scale_y_reversescale_y_sqrtScaleContinuousScaleContinuousDateScaleContinuousDatetimeScaleContinuousIdentityScaleContinuousPositionScaleDiscreteScaleDiscreteIdentityScaleDiscretePositionScalesListshould_stopStatstat_binstat_bin_2dstat_bin_hexstat_bin2dstat_binhexstat_contourstat_countstat_densitystat_density_2dstat_density2dstat_ecdfstat_ellipsestat_functionstat_identitystat_qqstat_smoothstat_spokestat_sumstat_summarystat_summary_2dstat_summary_binstat_summary_hexstat_summary2dstat_uniquestat_ydensityStatBinStatBin2dStatBindotStatBinhexStatContourStatCountStatDensityStatDensity2dStatEcdfStatEllipseStatFunctionStatIdentityStatQqStatSmoothStatSumStatSummaryStatSummary2dStatSummaryBinStatSummaryHexStatUniqueStatYdensitythemetheme_animinttheme_bwtheme_classictheme_darktheme_gettheme_graytheme_greytheme_lighttheme_linedrawtheme_minimaltheme_replacetheme_settheme_updatetheme_voidtoRGBtransform_positionunitupdate_galleryupdate_geom_defaultsupdate_labelsupdate_stat_defaultswaiverxlabxlimylabylimzeroGrob

Dependencies:clicolorspacedata.tabledigestevaluatefarverfastmapgluegtablehighrhttpuvjsonliteknitrlabelinglaterlifecyclemagrittrMASSmimemunsellplyrpromisesR6RColorBrewerRcppreshape2RJSONIOrlangscalesservrstringistringrvctrsviridisLitexfunyaml

Animint2 Quick Start Guide

Rendered fromanimint2.Rmdusingknitr::knitron Sep 17 2024.

Last update: 2023-11-16
Started: 2023-09-13

Readme and manuals

Help Manual

Help pageTopics
Add a new component to a ggplot or theme object.%+% %+replace% +.gganimint
Modify properties of an element in a theme objectadd_theme
Add a showSelected aesthetic if legend is specifiedaddShowSelectedForLegend
Add the showSelected/clickSelects params to the aesthetics mappingaddSSandCSasAesthetics
Define aesthetic mappings.aes
Define aesthetic mappings from strings, or quoted calls and formulas.aes_ aes_q aes_string
Colour related aesthetics: colour, fill and alphaaes_colour_fill_alpha color colour fill
Differentiation related aesthetics: linetype, size, shapeaes_linetype_size_shape linetype shape size
Position related aesthetics: x, y, xmin, xmax, ymin, ymax, xend, yendaes_position x xend xmax xmin y yend ymax ymin
Create an animintanimint
Compile and render an animint in a local directory.animint2dir
Publish a list of ggplots as interactive visualizations on a GitHub repositoryanimint2pages
Shiny ui output functionanimintOutput
Create an annotation layer.annotate
Annotation: Custom grob.annotation_custom
Annotation: log tick marksannotation_logticks
Annotation: maps.annotation_map
Annotation: High-performance rectangular tiling.annotation_raster
Coerce to labeller functionas_labeller
Convert a gganimintproto object to a listas.list.gganimintproto
Create a complete ggplot appropriate to a particular data typeautoplot
Create a layer of map borders.borders
The breakpointError of simulated signalsbreakpoints
Calculate the element properties, by inheriting properties from its parentscalc_element
Graphical model structure changechange
Check animation variable for errorscheckAnimationTimeVar
Check 'extra_params' argument for duplicates, non-named listcheckExtraParams
Check if showSelected and clickSelects have been used as aesthetics as in old syntax. If yes, raise errorcheckForSSandCSasAesthetics
Performs error checking on the plot for animint extensionscheckPlotForAnimintExtensions
Check plot.list for errorscheckPlotList
Issue warnings for non interactive plots where there is only one showSelected valuecheckSingleShowSelectedValue
ChromHMM iterationsChromHMMiterations
Climate data in central America from 1995 to 2000climate
Filter out columns that do not need to be copiedcolsNotToCopy
Testing rank and compare SVM on simulated patternscompare
Cartesian coordinates.coord_cartesian
Cartesian coordinates with fixed relationship between x and y scales.coord_equal coord_fixed
Flipped cartesian coordinates.coord_flip
Map projections.coord_map coord_quickmap
Polar coordinates.coord_polar
Transformed cartesian coordinate system.coord_trans
Cut up numeric vector into useful groups.cut_interval cut_number cut_width
Prices of 50,000 round cut diamondsdiamonds
US economic time series.economics economics_long
Theme element: blank. This theme element draws nothing, and assigns no spaceelement_blank
Theme element: line.element_line
Theme element: rectangle.element_rect
Theme element: text.element_text
Expand the plot limits with data.expand_limits
Lay out panels in a grid.facet_grid
Facet specification: a single panel.facet_null
Wrap a 1d ribbon of panels into 2d.facet_wrap
2d density estimate of Old Faithful datafaithfuld
FluViewFluView
Format a gganimintproto objectformat.gganimintproto
Fortify a model with data.fortify
Supplement the data fitted to a linear model with model fit statistics.fortify.lm
Fortify method for map objects.fortify.map
Fortify method for classes from the sp package.fortify.Line fortify.Lines fortify.Polygon fortify.Polygons fortify.sp fortify.SpatialLinesDataFrame fortify.SpatialPolygons fortify.SpatialPolygonsDataFrame
Functional Pruning AlgorithmFunctionalPruning
Evolution simulationgeneration.loci
Lines: horizontal, vertical, and specified by slope and intercept.geom_abline geom_hline geom_vline
Bars, rectangles with bases on x-axisgeom_bar stat_count
Add heatmap of 2d bin counts.geom_bin2d stat_bin2d stat_bin_2d
Blank, draws nothing.geom_blank
Display contours of a 3d surface in 2d.geom_contour stat_contour
Count the number of observations at each location.geom_count stat_sum
Vertical intervals: lines, crossbars & errorbars.geom_crossbar geom_errorbar geom_linerange geom_pointrange
Display a smooth density estimate.geom_density stat_density
Contours from a 2d density estimate.geom_density2d geom_density_2d stat_density2d stat_density_2d
Dot plotgeom_dotplot
Horizontal error barsgeom_errorbarh
Histograms and frequency polygons.geom_freqpoly geom_histogram stat_bin
Hexagon binning.geom_hex stat_binhex stat_bin_hex
Points, jittered to reduce overplotting.geom_jitter
Textual annotations.geom_label geom_text
Polygons from a reference map.geom_map
Connect observations.geom_line geom_path geom_step
Points, as for a scatterplotgeom_point
Polygon, a filled path.geom_polygon
Draw rectangles.geom_raster geom_rect geom_tile
Ribbons and area plots.geom_area geom_ribbon
Marginal rug plots.geom_rug
Line segments and curves.geom_curve geom_segment
Add a smoothed conditional mean.geom_smooth stat_smooth
A line segment parameterised by location, direction and distance.geom_spoke stat_spoke
ggplot2 geom with xmin and xmax aesthetics that covers the entire y range, useful for clickSelects background elements.geom_tallrect
Violin plot.geom_violin stat_ydensity
ggplot2 geom with ymin and ymax aesthetics that covers the entire x range, useful for clickSelects background elements.geom_widerect
Save the common columns for each tsv to one chunkgetCommonChunk
Gives a unique name to each layer in 'saveLayer'getLayerName
Get all parameters for a layergetLayerParams
Function to get legend information for each scalegetLegend
Function to get legend information from ggplotgetLegendList
Function to process text size with different types of unitgetTextSize
Get unique axis labels for the plotgetUniqueAxisLabels
Create a new gganimintproto objectgganimintproto gganimintproto_parent
Create a new ggplot plot.ggplot ggplot.data.frame ggplot.default
Save a ggplot (or other grid object) with sensible defaultsggsave
ggplot2 themesggtheme theme_bw theme_classic theme_dark theme_gray theme_grey theme_light theme_linedraw theme_minimal theme_void
Graphical units.pt .stroke graphical-units
Continuous colour bar guide.guide_colorbar guide_colourbar
Legend guide.guide_legend
Set guides for each scale.guides
Wrap up a selection of summary functions from Hmisc to make it easy to use with 'stat_summary'.hmisc mean_cl_boot mean_cl_normal mean_sdl median_hilow
Interval regressionintreg
Is an object a gganimintproto object?is.gganimintproto
Reports whether x is a rel objectis.rel
Check if character is an RGB hexadecimal color valueis.rgb
Reports whether x is a theme objectis.theme
Issue warnings for selectorsissueSelectorWarnings
Insert an interactive animation into an R markdown document using a customized print method.knit_print.animint
Backquoted labellerlabel_bquote
Generic labeller function for facetslabeller
Labeller functionslabellers label_both label_context label_parsed label_value label_wrap_gen
Change axis labels, legend titles, plot title/subtitle and below-plot caption.ggtitle labs xlab ylab
Retrieve the last plot to be modified or created.last_plot
Create a new layerlayer
Convenience functions to set the axis limits.lims xlim ylim
'colors()' in Luv space.luv_colours
Convenience function for an interactive bar that might otherwise be created using stat_summary(geom="bar").make_bar
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
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.make_tallrect_or_widerect
Convenvience function for a showSelected plot label.make_text
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_widerect
Malaria parasite genome variantsmalaria
Create a data frame of map data.map_data
Define margins.margin
Calculate mean and standard errors on either side.mean_se
Merge a list of data frames.merge_recurse
Midwest demographics.midwest
K-Nearest-Neighbors model of the mixture example datamixtureKNN
Montreal bikesmontreal.bikes
Fuel economy data from 1999 and 2008 for 38 popular models of carmpg
An updated and expanded version of the mammals sleep dataset.msleep
Environment to store meta datanewEnvironment
Convert a ggplot to a list.parsePlot
Consistency of segmentation models in simulated Poisson peaksPeakConsistency
Worldwide pirate attacks from 1978 to 2013pirates
Adjust position by dodging overlaps to the side.position_dodge
Stack overlapping objects on top of one another.position_fill position_stack
Don't adjust positionposition_identity
Jitter points to avoid overplotting.position_jitter
Adjust position by simultaneously dodging and jitteringposition_jitterdodge
Nudge points.position_nudge
Terms of 11 presidents from Eisenhower to Obama.presidential
print animintprint.animint
Draw plot on current graphics device.plot.gganimintplot print.gganimintplot
Print a gganimintproto objectprint.gganimintproto
Class prior changeprior
Lasso model of the prostate cancer data setprostateLasso
Convert 'pt' value to 'lines'pt.to.lines
Quick plotqplot quickplot
Relative sizing for theme elementsrel
Create an animint output elementrenderAnimint
Compute the "resolution" of a data vector.resolution
Split data set into chunks and save them to separate files.saveChunks
Alpha scales.scale_alpha scale_alpha_continuous scale_alpha_discrete
Sequential, diverging and qualitative colour scales from colorbrewer.orgscale_color_brewer scale_color_distiller scale_colour_brewer scale_colour_distiller scale_fill_brewer scale_fill_distiller
Smooth gradient between two coloursscale_color_continuous scale_color_gradient scale_color_gradient2 scale_color_gradientn scale_colour_continuous scale_colour_date scale_colour_datetime scale_colour_gradient scale_colour_gradient2 scale_colour_gradientn scale_fill_continuous scale_fill_date scale_fill_datetime scale_fill_gradient scale_fill_gradient2 scale_fill_gradientn
Sequential grey colour scale.scale_color_grey scale_colour_grey scale_fill_grey
Qualitative colour scale with evenly spaced hues.scale_color_discrete scale_color_hue scale_colour_discrete scale_colour_hue scale_fill_discrete scale_fill_hue
Continuous position scales (x & y).scale_continuous scale_x_continuous scale_x_log10 scale_x_reverse scale_x_sqrt scale_y_continuous scale_y_log10 scale_y_reverse scale_y_sqrt
Position scale, date & date timesscale_date scale_x_date scale_x_datetime scale_y_date scale_y_datetime
Use values without scaling.scale_alpha_identity scale_color_identity scale_colour_identity scale_fill_identity scale_identity scale_linetype_identity scale_shape_identity scale_size_identity
Scale for line patterns.scale_linetype scale_linetype_continuous scale_linetype_discrete
Create your own discrete scale.scale_alpha_manual scale_color_manual scale_colour_manual scale_fill_manual scale_linetype_manual scale_manual scale_shape_manual scale_size_manual
Scale for shapes, aka glyphs.scale_shape scale_shape_continuous scale_shape_discrete
Scale size (area or radius).scale_radius scale_size scale_size_area scale_size_continuous scale_size_date scale_size_datetime scale_size_discrete
Scale point sizes using circle area, but specifying the radius in pixels.scale_size_animint
Discrete position.scale_x_discrete scale_y_discrete
Vector field of seal movements.seals
Separate .variable/.value selectorsselectSSandCS
Set plot width and height for all plotssetPlotSizes
Split data.frame into recursive list of data.frame.split_recursive
Empirical Cumulative Density Functionstat_ecdf
Plot data ellipses.stat_ellipse
Superimpose a function.stat_function
Identity statistic.stat_identity
Calculation for quantile-quantile plot.geom_qq stat_qq
Bin and summarise in 2d (rectangle & hexagons)stat_summary2d stat_summary_2d stat_summary_hex
Summarise y values at unique/binned x x.stat_summary stat_summary_bin
Remove duplicates.stat_unique
Flip axes in case of coord_flip Switches column names. Eg. xmin to ymin, yntercept to xintercept etc.switch_axes
Test ROC curvesTestROC
Set theme elementstheme
theme for passing animint specific paramstheme_animint
Get, set and update themes.theme_get theme_replace theme_set theme_update
Convert R colors to RGB hexadecimal color valuestoRGB
Function to transform R shapes into d3 shapes...transform_shape
Translating between qplot and ggplottranslate_qplot_ggplot
Translating between qplot and latticetranslate_qplot_lattice
Housing sales in TX.txhousing
Update galleryupdate_gallery
Modify geom/stat aesthetic defaults for future plotsupdate_geom_defaults update_stat_defaults
Update axis/legend labelsupdate_labels
Tornadoes in the United States from 1950 to 2012UStornadoes
Error rates of supervised learning methods for variant callingVariantModels
Extract subset for each data.frame in a list of data.framevaried.chunk
Vervet monkey intestinal microbiomevervet
Demographics by country from 1960 to 2012WorldBank
World population by subcontinentworldPop