ggspectra 0.3.10

This update to ‘ggspectra’ tracks changes in ‘photobiology’ 0.10.15, ‘photobiologyWavebands’ 0.5.1 and ‘ggplot2’ 3.4.0, as well as in R 4.1.0. These are mostly deprecations that would trigger warnings. Please, be aware that these versions or later are now required.

The corrected definition of PAR() in ‘photobiologyWavebands’ 0.5.1 is code breaking as this change will cause some plots, especially annotations in them to change, when PAR() has been explicitly called in users’ code for quantities that are not photon based, in most cases with a warning.

New x scales and new functions  for adding secondary x axes have been implemented.

Continue reading

ggspectra 0.3.9

Some of the code in this package is rather complex and contained syntax and constructs that were known for some time to be on their way to deprecation and removal in different packages from the ‘tidyverse’. Updating the package to the syntax used in current ‘ggplot2’ versions had been in my to do list for some time. Now the update had to be done, and it is now done.

Continue reading

ggpmisc 0.5.1

Version 0.5.1 brings additional enhancements to the annotations based on model fits. These enhancements improve traceability by updating statistics to return additional information about the fitted models. Functions in ‘ggplot2’ that had been earlier announced as being at their end-of-life have now been deprecated. Some instances aes_() had remained lingering in the code and had to be replaced by aes() .

Continue reading

ooacquire 0.2.4 and 0.2.5

The main new feature in version 0.2.5 is that the package can be installed and used in an off-line mode without need to install what were previously system requirements and required packages. In this mode data acquisition and communication with spectrometers is disabled, but processing of spectral data previously acquired or acquired with a different computer or using other software remains available unchanged.

Version 0.2.4 brings some improvements to the user interface for interactive data acquisition. It also fixes problems caused by code-breaking changes in package ‘readr’.

Continue reading

ggpmisc 0.5.0

Version 0.5.0 (previously announced as 0.4.8) brings enhancements to the annotations based on model fits. The most significant change for all users is the new convenience function use_label() that greatly simplifies the assembly of labels from components and their mapping to aesthetics. We examplify its use and some of the other new features. It also contains two changes that are not backwards compatible and that can in isolated cases break existing code (hence the version-number change into 0.5.0).

Continue reading

ggpmisc 0.4.7

Version 0.4.7 brings a fix for a bug that could prevent the use of weights passed through aesthetic weight in some of the model-fitting statistics. Several enhancements to the model fitting statistics make it easier to fit different models to different groups or panels, and make it possible/easier to select among methods supported by a model fit function.

Continue reading

ggspectra 0.3.8

Eighteen months from the previous release, this update brings many improvements to autoplot() methods. These include enhanced capabilities for handling of normalized and scaled spectral data, as well as cosmetic tweaks to labels.

This update also includes smaller enhancements and fixes a bug. It tracks changes in packages ‘ggrepel’ (>= 0.9.1), ‘photobiology’ (>= 0.10.10) and ‘ggplot2’ (>= 3.3.3) and deprecation of functions in ‘tidyr’ (>= 1.0.0). The updated code depends on the revised normalize() function in ‘photobiology’ (>= 0.10.10) and on ‘ggrepel’ (>= 0.9.1).

Continue reading

Plans for upcoming versions of the suite

I just want to share what is in my “to do” list and what I wish someone else could contribute to the R for photobiology suite of packages either as part of the suite or as independent extensions. In addition to the enhancements listed below, I hope at some point to be able to submit the packages in the suite to R Open Science to be peer reviewed.

Continue reading

photobiologyInOut 0.4.23

Fifteen months since the previous release, this update adds support for one new spectrometer from LI-COR and multiple spectrometers from Wasatch Photonics. Updates to the tidyverse were triggering deprecation notices which are now avoided. Updates to package ‘photobiology’ revealed some minor bugs that are also fixed. Unnecessary progress messages during file realing and text scanning have been silenced.

The main changes from version 0.4.22 the previous CRAN release, are:

  • Add parameters na and ... to read_csi_data().
  • Add function read_wasatch_csv() supporting data import from long form CSV spectrum files saved by Wasatch’s Enlighten program.
  • Add function read_li180_txt() supporting data import from files saved by the LI-180 handheld array spectrometer from LI-COR.
  • Avoid spurious progress messages when reading files.
  • Track various changes in the tidyverse that deprecated functions used in this package.
  • Fix bugs in some imports from ‘photobiology’.
  • Move git repository from Bitbucket to Github.
  • Set up Github action for CRAN-checks on Windows, OS X and Ubuntu.
  • Documentation web site at

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

Please raise issues concerning bugs or enhancements to this package through Bitbucket at

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.


The package documentation web site at: 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 Pull requests are also welcome.


The package documentation web site at: 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 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 and 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.