gginnards 0.1.0

All edits in this update are related to the debug geom and stats. Overall the edits aim at simplifying the interface and ensuring that the package works with recent versions of ‘ggplot2’. Because of the way ggplot works, geoms used as argument to stats may not see all default arguments, so a simpler interface makes use easier.

Changes compared to ‘gginnards’ 0.0.4:

  • Add geom_debug_npc() as a synonym for geom_debug() to allow debugging of geoms supporting npc coordinates as defined in package ‘ggpp’.
  • Revise stat_debug_group() and stat_debug_panel() simplifying the output to the console. In particular avoid setting default aesthetics, change default for geom to "debug" and used head() as default for summaries .
  • Revise geom_debug() setting head() as default for summary.fun.
  • Revise part 1 of the User Guide.Some of these changes to default arguments and function parameters are code-breaking but of little consequence as these debugging functions are meant to be used interactively.

Documentation web site at http://docs.r4photobiology.info/gginnards/ includes all help pages, with output from all examples, and vignettes in HTML format.

NOTE: The new version of the package is on its way to CRAN.

Please raise issues concerning bugs or enhancements to this package through GitHub https://github.com/aphalo/gginnards/issues

ggpmisc 0.4.0 and ggpp 0.4.0

The main change is the split of package ‘ggpmisc’ into two packages. Starting from this version, package ‘ggpmisc’ focuses only on plot annotations related to model fits and statistical summaries. The new package ‘ggpp’ contains generally useful extensions to the grammar of graphics such as new geometries and position functions. As package ‘ggpmisc’ loads package ‘ggpp’ the migration should have minimal if any impact on users’ code. Package ‘ggpp’ will be most useful to authors of packages that currently import ‘ggpmisc’, including myself. It is good to be aware that the split almost exactly follows the subject matter of the two vignettes previously part of ‘ggpmisc’. When using ‘ggpmisc’, users will notice that some functions have migrated only when consulting the documentation.

‘ggpp’

The package documentation web site at: https://docs.r4photobiology.info/ggpp/ includes a changelog.

Compared to ‘ggpmisc’ 0.3.9, the following changes have been introduced. New justification styles have being implemented to complement position_nudge_center(). They are supported in geom_text_linked(), geom_plot(), geom_table(), geom_grob() and geom_marging_grob(). In the current implementation all rows in data should contain the same hjust or vjust value when using the new types of justification described here, this seems reasonable as they compute the individual justification values from the data. All other justification values, either numeric or character do not have this restriction and can be used as in geoms from ‘ggplot2’. These new features may change in the near future.

  • Rename geom_text_linked().
  • Implement justifications "outward_mean", "inward_mean", "outward_median" and "inward_median" so that outward and inward are with respect to the centroid of the data instead of to the middle of the x or y scales. This should be useful in combination with position_nudge_center().
  • Implement justifications "outward_nnn" and "inward_nnn" so that outward and inward are with respect to the number resulting from applying as.numeric() to the characters that replace nnn. For example strings like "outward_0.5", "inward_3e5" or "outward_-3e-2" are supported. This should be useful when manual tweaking is desired. As special cases "outward_0" and "inward_0" apply justification outward and inward with respect to the origin. This should be useful for biplots used for PCA and similar cases with arrows radiating out of the origin. (The "outward" and "inward" justification implemented in ‘ggplot2’ is relative to the middle of the x or y scales.)
  • Revise compute_npcx() and compute_npcy() to support multiple steps per group (needed in ‘ggpmisc’).
  • Fix problem related to "outward" and "inward" justification of text labels when angle aesthetic takes values < -45 or > 45 degrees. This code change alters how old plots are rendered if text labels have been rotated by more than 45 degrees.
  • [‘ggplot2’, ‘ggrepel’] The problem with angle was a “bug” in ‘ggplot2’ also present in ‘ggrepel’. A pull request for ggplot2::geom_text() has been submitted and merged. This is now in the ‘ggplot2’ 3.3.4 milestone retaining consistent behaviour between ‘ggplot2’, ‘ggrepel’, ‘ggpp’ and ‘ggpmisc’.

Please raise issues concerning bugs or enhancements to this package through GitHub at https://github.com/aphalo/ggpp/issues. Pull requests are also welcome.

‘ggpmisc’

The package documentation web site at: https://docs.r4photobiology.info/ggpmisc/ includes a changelog.

Changes from ‘ggpmisc’ version 0.3.9, the most recent CRAN release, are:

  • Add stat_quant_eq() based on quantile regression as implemented in package ‘quantreg’. (enhancement suggested by Mark Neal)
  • Add n.label and n to the values returned by stat_poly_eq() and stat_quant_eq(). (enhancement suggested by a question from ganidat)
  • Add r.squared, adj.r.squared, p.value and n as numeric to values returned in addition to the corresponding character labels when stat_poly_eq() is called with output.type other than numeric. Similarly for n and rho in the case of stat_quant_eq(). (enhancement suggested by a question from Tiptop)
  • Fix bug in stat_poly_eq() leading to empty returned value when data contains too few observations to fit the model. (reported by ganidat)
  • Add support for quantile regression rq, robust regression rlm, and resistant regression lqs and function objects to stat_fit_deviations().

Please raise issues concerning bugs or enhancements to this package through GitHub at https://github.com/aphalo/ggpmisc/issues. Pull requests are also welcome.

Acknowlegements: I thank Kamil Slowikowski for his contributions of ideas and for his willingness to keep the development of our packages coordinated. This update was done in part to address questions raised and reports of bugs by users, which I thank. The tag [ggpmisc] is in use at stackoverflow for questions related to the use these two packages. I thank Mark Neal for the suggestion that lead to the new statistic stat_quant_eq() and for his help during its testing. I thank Stackoverflow users ganidat and Tiptop for enhancement ideas.

Documentation web sites at https://docs.r4photobiology.info/ggpmisc/ and https://docs.r4photobiology.info/ggpp/ include all help pages, with output from all examples, and vignettes in HTML format. The online vignettes include the output of all code examples, while the vignettes as included in the package, contain the output of only a subset of the code examples so as to keep the documentation at a reasonable size for package distribution.

NOTE: The new package ‘ggpp’ (0.4.0)  is in CRAN and updated ‘ggpmisc’ (0.4.0) is on its way to CRAN. The latest development versions of both packages can be installed from GitHub.

remotes::install_github("aphalo/ggpp")
remotes::install_github("aphalo/ggpmisc")

photobiology 0.10.6

The package documentation web site at https://docs.r4photobiology.info/photobiology/ includes a changelog with information for each release since version 0.1.0.

This release includes fixes to several minor bugs that were reported during the last seven months. In addition to these fixes new specializations of existing methods were added to improve the consistency across the different methods and classes. The Git repository was recently moved from Bitbucket to GitHub and continuous integration using Git actions set up.

Changes from version 0.10.5 the most recent CRAN release, are:

  • Fix boundary-condition bug in msmsply().
  • Fix handling of na.rm = TRUE in find_peaks().
  • Revise the computation of the default for dyn.range in cps2Tfr() and cps2Rfr() so that it takes into account the relative signal in
    the reference spectrum.
  • Add parameter missing.pixs to cps2irrad() so that corrupted too-short spectra can be converted if the location of missing pixels
    is known.
  • Add row-wise summaries for raw_mspct and cps_mspct objects.
  • Add support of multiple spectra in long form to irrad(), e_irrad(), q_irrad(), q_ratio(), e_ratio(), qe_ratio(), eq_ratio(), absorbance(), absorptance(), trasmittance(), reflectance() methods.
  • Add warning for handling of multiple spectra in long form to integrate_spct() method.

NOTE: The updated package is on its way to CRAN.

Please raise issues concerning bugs or enhancements to this package through GitHub at https://github.com/aphalo/photobiology/issues

ggpmisc 0.3.9

Package ‘ggpmisc’ focuses mainly on plot annotations. The new version fixes minor bugs and adds a major new feature: position functions for data aware nudging. These nudge functions were born out of an exchange of ideas with Kamil Slowikowski, the author and maintainer of the very popular package ‘ggrepel’. We are currently considering how to make them compatible with geom_text_repel() and geom_label_repel().

The package documentation web site at: https://docs.r4photobiology.info/ggpmisc/ now includes a changelog, so I am brief here.

Changes from version 0.3.8, the most recent CRAN release, are:

  • Update the documentation of geom_plot().
  • [Under development!] Link repositioned text to its original position with a segment or arrow: geom_linked_text(). Except for
    the drawing of segments or arrows this new geometry behaves as ggplot2::geom_text() . Note: Segments and arrows are drawn only
    if the position function used returns both the repositioned and original coordinates.
  • Add support for advanced nudging: position_nudge_centre() and position_nudge_line() compute the direction of nudging and return
    both the nudged and original positions.
  • Add support for simple nudging: position_nudge_to() nudges to new user-supplied position(s); position_nudge_keep() nudges to
    position(s) based on user-supplies position shift. These functions return both nudged and original position(s).

Example: Nudging text labels away from a curve.

library(ggpmisc)

set.seed(16532)
df <- data.frame(
  x = -10:10,
  y = (-10:10)^2 + rnorm(21, 0, 4),
  l = letters[1:21]
)

ggplot(df, aes(x, y, label = l)) +
  geom_point() +
  stat_smooth(method = "lm", formula = y ~ poly(x, 2, raw = TRUE)) +
  geom_text(aes(y = y, label = l),
            position = position_nudge_line(method = "lm",
                                           x = 0.4, 
                                           y = 4,
                                           formula = y ~ poly(x, 2, raw = TRUE),
                                           direction = "split"))
The resulting plot.

Nudging of text labels away from a curve.

Roadmap: A split of the ‘ggpmisc’ package into two packages, one including the extensions to the grammar of graphics and another one including the functions related to plot annotations based on model fitting and statistical summaries seems necessary as the package has grown to include several extensions to the grammar of graphics that are generally useful. We are also working on improved inter-operation between ‘ggpmisc’ and ‘ggrepel’.

Acknowlegement: I thank Kamil Slowikowski for his contributions of ideas and for his willingness to keep the development of our packages coordinated. This update was done in part to address questions raised and reports of bugs by users, which I thank. The tag [ggpmisc] is in use at stackoverflow for questions related to the use this package. Please raise issues concerning bugs or enhancements to this package through GitHub at https://github.com/aphalo/ggpmisc/issues. Pull requests are also welcome.

Documentation web site at http://docs.r4photobiology.info/ggpmisc/ includes all help pages, with output from all examples, and vignettes in HTML format. The online vignettes include the output of all code examples, while the vignettes as included in the package, contain the output of only a subset of the code examples so as to keep the documentation at a reasonable size for package distribution.

NOTE: The new version of the package is on its way to CRAN.