Learn R Programming

ggpmisc (version 0.2.8)

ggpmisc-package: Miscellaneous Extensions to 'ggplot2'

Description

Extensions to 'ggplot2' respecting the grammar of graphics paradigm. Provides new statistics to locate and tag peaks and valleys in 2D plots, a statistics to add a label with the equation of a polynomial fitted with lm(), or R^2 or adjusted R^2 or information criteria 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 statistics and two geometry useful for diagnosing what data are passed to compute_group() and compute_panel() functions and to geometries.

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. Extensions provided:
  • Function for conversion of time series data into data frames that can be plotted with ggplot.
  • Stats for locating and tagging "peaks" and "valleys" (local or global maxima and minima).
  • Stat for generating labels from alm()model fit, including formatted equation.
  • "Debug" stats and a "debug" geom that print to the console a summary ot theirdatainput.
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

Package suite 'r4photobiology' web site at http://www.r4photobiology.info/ Package 'ggplot2' web site at http://ggplot2.org/ Package 'ggplot2' documentation at http://docs.ggplot2.org/ Package 'ggplot2' source code at https://github.com/hadley/ggplot2