R package 'ggpmisc'

Package 'ggpmisc' (Miscellaneous Extensions to 'ggplot2') is a set of extensions to R package 'ggplot2' (>= 2.1.0) which I hope will be useful when plotting diverse types of data. Currently available stats add the following statistics, geoms and function:

  • stat_peaks() find and label local or global maxima in y.
  • stat_valleys() find and label local or global minima in y.
  • stat_poly_eq() add a label for a fitted linear model to a plot, label can be the fitted polynomial equation, R^2, BIC, AIC.
  • stat_fit_deviations() display residuals from a model fit as segments linking observed and fitted values.
  • stat_fit_residuals() residuals from a model fit.
  • stat_fit_augment() data augmented with fitted values and statistics using package 'broom'.
  • stat_fit_glance() one-row summary data frame for a fitted linear model using package 'broom'.
  • stat_debug_group(), stat_debug_panel() print data received as input by a stat's group and panel functions respectively. Useful for debugging new statistics and for exploring how ggplot works.
  • geom_debug() print data received as input by a geom.
  • try_data_frame() convert an R object into a data frame. Specially useful for plotting time series (using internally package '') which are returned with x data as POSIXct, allowing direct plotting with 'ggplot2' and packages extending 'ggplot2'.

The package manual describes in more detail the items listed above, and the vignette gives several examples of plots produced with the package.

Please, see the web site r4photobiology for details and update notices. Other packages, aimed at easing photobiology-related calculations including the quantification of biologically effective radiation in meteorology are available as part of a suite described at the same website.

The current release of 'ggpmisc' is available through CRAN for R (>= 3.2.0).