Learn R Programming

ggpmisc (version 0.2.5)

ggpmisc-package: Miscellaneous Extensions to 'ggplot2'

Description

Implements extensions to 'ggplot2' respecting the grammar of graphics paradigm. Provides new stats to locate and tag peaks and valleys in 2D plots, a stat to add a label by group with the equation of a polynomial fitted with lm(), or R^2 or adjusted R^2 values for any model fitted with function lm(). Provides a function for flexibly converting time series to data frames suitable for plotting with ggplot(). In addition provides two stats useful for diagnosing what data are passed to compute_group() and compute_panel() functions.

Arguments

Details

The new facilities for cleanly defining new stats and geoms added to ggplot2 in version 2.0.0 have made this package easy to code. However, this means that this package requires version 2.0.0 or later of ggplot2. The stats for peaks and valleys are coded so as to work correctly both with numeric and POSIXct variables mapped to the x aesthetic. Special handling was needed as text labels are generated from the data.

References

ggplot2 web site at http://ggplot2.org/ ggplot2 source code at https://github.com/hadley/ggplot2