animate_ordination: Create animations using ordination results

Description Usage Arguments Value References See Also Examples

View source: R/animation-methods.R

Description

An interesting subset of analyses of large phylogenetic sequencing projects is to produce an ordination based on all of the samples in the project, and then plot the relative “movement” of the samples (often microbial communities) over time. This function is intended to produce just that. It expects that you will provide a phyloseq-class object, an ordination result based on that object, and the variable name of the “time” covariate within the sampleData-class component of the phyloseq object. A great many parameters are passed on to animate, or even further to ani.options.

Usage

1
2
3
  animate_ordination(physeq, t, ord.result, axes = c(1, 2),
    color=NULL, shape=NULL, ggplot2_expr=NULL,
    movie.name="animation.gif", ...)

Arguments

physeq

(Required). A phyloseq-class that contains a sampleData-class component with at least three covariates, one of which that can be mapped to “time” (really sampling-order).

t

(Required). A character-class. The name of the time variable in physeq.

ord.result

(Required). An ordination result, as defined by the vegan-package.

axes

(Optional). A two-element integer vector that defines the axes (aka coordinate, component, dimension) within the ordination result that will be used. Default is to take the first two axes (a good place to start). c(1, 2)

color

(Optional). A character-class. The name of the variable in physeq that will be mapped to color. Default is NULL (no color mapping).

shape

(Optional). A character-class. The name of the variable in physeq that will be mapped to shape. Default is NULL (no shape mapping).

ggplot2_expr

(Optional). A character-class. A single (potentially long) character string that is a ggplot2 expression for additional graphical layers/options. For example, the following ggplot2 expression, if provided, would cause each frame to be faceted in a wrap by the Subject factor with 3 rows, and also use the black and white theme:

"facet_wrap(~Subject, nrow=3) + theme_bw()"

movie.name

(Optional). A character string of the desired name for the output movie file. Default is "animation.gif"

...

(Optional). Additional arguments passed to ani.options.

Value

A .gif animation file. Support is planned for other output file types supported by animation.

References

http://cran.r-project.org/web/packages/animation/animation.pdf

See Also

animation, phyloseq-package

Examples

1
#####

joey711/animate.phyloseq documentation built on May 19, 2019, 3:01 p.m.