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(). Additional statistics give access to functions in package 'broom'. Provides a function for flexibly converting time series to data frames suitable for plotting with ggplot(). In addition provides statistics and ggplot geometries useful for diagnosing what data are passed to compute_group() and compute_panel() functions and to geometries.
Package 'ggpmisc' (Miscellaneous Extensions to 'ggplot2') is a set of extensions to R package 'ggplot2' (>= 2.1.0) useful when plotting diverse types of data.
Functions try_data_frame() and try_tibble() can be used to convert time series objects into data frames or tibbles suitable for plotting. To complement these functions ggplot methods for "ts" and "xts" classes are defined.
Different statistics, geometries and functions add facilities for labelling peaks and valleys, generating labels for fitted models including polynomial equations, highlighting deviations from a model fit, and for filtering-out regions of plot panels with high densities of observations (with stats designed to work nicely together with package 'ggrepel').
Another group of ggplot statistics and geometries which echo their input aim at easing debugging during development of new geoms and statistics (or learning how they work).
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).
Fix bugs in try_tibble() and try_data_frame() which made them fail silently with some objects of class "ts" in the case of numeric (decimal date) index for time. In addition lack of special handling for classes "yearmon" and "yearqrt" from package 'zoo', lead to erroneous date shifts by a few days. Add methods ggplot.ts() and ggplot.xts().
Change default value for parameter label.fill in stat_dens2d_labels() from NA to "". Improve documentation using current 'ggrepel' version, which implements changes that make stat_dens2d_labels() useful.
Add stat_dens2d_labels(), a statistic that resets label values to NA by default,
or any character string supplied as argument, in regions of a panel with high
density of observations.
Add stat_den2d_filter(), a statistic that filters-out/filters-in observations
in regions of a panel with high density of observations.
These two statistics are useful for labelling or highlighting observations in
regions of a panel with low density. Both stats use a compute_panel function.
Add stat_den2d_filter_g(), a statistic that filters-out/filters-in observations
in regions of a group with high density of observations. This statistics is
useful for highlighting observations. It uses a compute_group function.
They use internally
MASS:kde2d to estimate densities and default values for
parameters are adjusted dynamically based on the number of observations.
Add user-requested feature: allow user to specify number 'digits' used in formatting numbers in labels in stat_poly_eq(). Update try_data_frame() to return an object of class "tibble" and add try_tibble() as synonym. Update documentation and start using package 'staticdocs' to build a documentation web site.
Add support for tikz in stat_poly_eq(). Fix bug in stat_poly_eq(). Fix bug in geom_debug(). Fix bug in stat_fit_augment().
Enhance stat_poly_eq() so that 1) position of labels according to npc (relative positions using normalized coordinates), as well as by named positions "top", "bottom", "right", "left" and "center" is now implemented; 2) when grouping is present, suitable vjust values are computed to automatically position the labels for the different groups without overlap. Default label positions are now relative to the range of each panel's $x$ and $y$ scales, eliminating in most cases the need to manually tweak label positions.
Add stat_fit_glance() uses package 'broom' for maximum flexibility in model function choice when wanting to add labels based on information from a model fit, at the expense of very frequently having to explicitly set aesthetics, and always having to add code to do the formatting of the values to be used in labels. Label position is as described above for stat_poly_eq().
Add stat_fit_deviations() for highlighting residuals in plots of fitted models. This statistic currently supports only lm() fits. By default geom "segment" is used to highlight the deviations of the observations from a fitted model.
Add stat_fit_residuals() for plotting residuals from a fitted model on their own in plots matching plots of lm fits plotted with stat_smooth() even with grouping or facets. This statistic currently supports only lm() fits. By default geom "point" is used to plot the residual from a fitted model.
Add preliminary version of stat_fit_augment(), which uses package 'broom' for maximum flexibility in model function choice, to augment the data with additional columns of values derived from a model fit.
Add support for AIC and BIC labels to stat_poly_eq(). Add pretty-printing of parameter values expressed in engineering notation in stat_poly_eq(). Add support for user-supplied label coordinates in stat_poly_eq(). Improve stat_debug_panel() and stat_debug_group() so that they can optionally print to the console a summary of the data received as input. Add geom_debug(), a geom that summarizes its data input to the console, and produces no visible graphical output.
Add support for user-supplied lhs and for user-supplied rhs-variable name in the equation label in stat_poly_eq().
Remove one example to remove a package dependency.
Improve handling of time zones in try_data_frame(). Revise documentation and vignette.
stat_poly_eq() changed to include the lhs (left hand side) of the equation by default.
Add function try_data_frame() to convert R objects including time series objects of all classes accepted by try.xts() into data frames suitable for plotting with ggplot().
Update stat_peaks() and stat_valleys() to work correctly when the x aesthetic uses a Date or Datetime continuous scale such as ggplot() sets automatically for POSIXct variables mapped to the x aesthetic.
Rename stat_debug() as stat_debug_group() and add stat_debug_panel(). Add stat_peaks() and stat_valleys() (these are simpler versions of ggspectra::stat_peaks() and ggspectra::stat_valleys() for use with any numerical data (rather than light spectra).
First version. Add stat_poly_eq() Add stat_debug()