photobiology 0.10.3

Package documentation web site at: https://docs.r4photobiology.info/photobiology/

This release was triggered by problems detected by new tighter CRAN checks in what will become R (4.1.0). Better quality checks are a good thing! A few unrelated enhancements are also included.

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

New

  • Implement Fresnel’s formulae for computation of reflectance of a plane interface from relative refractive index.
  • Implement Fraunhofer’s formulae for computation of diffraction in a single slit and diffraction plus interference in a double slit.
  • Enhance as_tod() and implement format() and print() methods for time-of-day.
  • Update tag() methods to use, when possible, precomputed color definitions to improve performance.

Fixed

  • Handle gracefully bad data input in normalised_diff_ind().
  • Remove bad class exports from NAMESPACE.

Compatibility

  • New features of ‘dplyr’ (>= 1.0.0) are used, so this new version is required.

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

Please raise issues concerning bugs or enhancements to this package through Bitbucket https://bitbucket.org/aphalo/photobiology/issues

photobiologyWavebands 0.4.4

Package documentation web site at: https://docs.r4photobiology.info/photobiologyWavebands/

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

New

  • NDVI() for computing the Normalized Difference Vegetation Index from spectral transmitance.

Fixed

  • Avoid warnings during building of vignettes, caused by changes to the options recognized by ‘roxygen2’.
  • Update URLs to secure ones if available.

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

Please raise issues concerning bugs or enhancements to this package through Bitbucket at https://bitbucket.org/aphalo/photobiologywavebands/issues

photobiology 0.10.2

Package documentation web site at: https://docs.r4photobiology.info/photobiology/

This new update comes on the steps of the two previous ones (0.10.0, 0.10.1) and fixes a few bugs found since.

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

Bugs fixed

  • color_of() was failing in some cases when it should not.
  • merge2object_spct(), merge_attributes(), interpolate_spct(), [ ] were in certain cases dropping attributes, in most but not all cases only filter.properties.
  • White LED example spectra may have had attributes inconsistently set.
  • Additional test cases were added (a suite of 4165 automatic test cases is used before release).

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

Please raise issues concerning bugs or enhancements to this package through Bitbucket https://bitbucket.org/aphalo/photobiology/issues

photobiology 0.10.1

Package documentation web site at: https://docs.r4photobiology.info/photobiology/

Continuing with the work released in version 0.10.0, this version includes significant new functionality as well as bug fixes and the rewriting of some smelly/ugly code previously used for the dispatch of math operators and functions. It also includes performance optimizations in the computations of color definitions from wavelengths.

In brief, this update brings: 1) improved handling of conversions among quantities used to describe filters, which required adding a mechanism to store properties of filters as metadata, and revising the code behind mathematical operations and mathematical functions related to filter_spct objects; 2) Support for use of arbitrary chromaticity definitions for tagging of spectra; 3) Changes to error checking and messages, including changing several earlier warnings into errors; several important bug fixes.

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

New

  • setFilterProperties(), getFilterProperties(), filter_properties() and filter_properties<-().
  • print() method for filter properties.
  • convertTfrType(), convertThickness().
  • Example data for filters updated with filter properties.
  • Afr2T(), T2Afr(), any2T(), any2A(), and any2Afr().
  • is_absorptance_based().
  • wls_at_target() method for data frames.
  • rbindspct() now allows control of metadata copying

Bugs fixed

  • Serious bug in T2Afr() was causing wrong values to be returned!!
  • Serious bug in clean.object_spct().
  • Revise find_peaks() so that arguments passed to ignore.threshold and strict are obeyed also when span = NULL.

Defunct

  • T2T(), setAfrType(), getAfrType().

Note

Full functionality of convertThickness() and convertTfrType() requires filter_spct objects to have the new "filter.properties" attribute or contain a column "Rfr" with reflectance data like object_spct objects. This means that until packages ‘photobiologyFilters’ and ‘photobiologyPlants’ are updated, these functions cannot be used with the spectral data they contain.


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

Please raise issues concerning bugs or enhancements to this package through Bitbucket https://bitbucket.org/aphalo/photobiology/issues

photobiology 0.10.0

After 30 releases in the 0.9.xx version series, we have reached version 1.10.1. The change to a new series is because of some potentially code-breaking changes in the returned values of summary functions. This update also coincides with major updates to ‘tidyverse’ packages. Compatibility required some rather minor changes to the code in this package. Compatibility with ‘tibble’ (3.0.0) and with the soon to be released versions of ‘dplyr’ (1.0.0), ‘rlang’ and ‘vctrs’ has been tested. This version also includes significant new functionality.

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

Enhance peak- and valley-related functions

  • Revise peaks() and valleys() methods to support peak fitting or “refinement”. Currently only spline interpolation is implemented. Default behaviour remains unchanged. (The implementation of peak fitting is still experimental and returned values may not be reproducible with future versions of the package.)

Enhance summary functions

  • Revise q_ratio(), e_ratio(), qe_ratio() and eq_ratio() adding new parameter scale.factor.
  • Revise irrad(), q_irrad() and e_irrad(); fluence(), q_fluence(), and e_fluence(); q_ratio(), e_ratio(), qe_ratio() and eq_ratio(); response(), q_response(), and e_response() methods so that they add shorter but still informative names to returned numeric values and to columns in returned data frames. Add formal parameters naming and name.tag to allow user control of the names.
  • Revise absorbance(), absorptance(), transmittance() and reflectance() so that they create shorter, and more informative names for returned values.
  • Revise msdply() to treat as special cases all the methods described above, to support the especializations of these methods for collections of spectra. For those functions not handled as special cases, returned values are, as earlier, tagged with the name of the applied function.

Add methods for extraction of spikes and for despiking

  • Add function find_spikes() for numeric vectors, useful for Raman spectra or array detectors with hot pixels.
  • Add function replace_bad_pixs() operating on numeric vectors.
  • Add method spikes() for vectors, data frames and spectra.
  • Add method despike() for vectors, data frames and spectra.

Add example data

  • Add data for cone fundamentals for human vision.

Fix bugs

  • Revise trim_waveband() so that it preserves the names of list members. This bug affected computations of irradiances and ratios so that names used in lists of wavebands where not reflected in the output, and the label from the waveband definitions could not be overriden as intended by design.
  • Ensure that irrad() and response() always label the returned values correctly. Values are now always tagged according to the units used, even when these are selected by setting R options; i.e., values returned by irrad() and response() are always labelled identically as those returned by q_irrad(), e_irrad(), q_response() and e_response().
  • Relax check for w.length range allowing longer wavelengths (IR). In addition triggering of an error for unlikely wavelengths has been replaced by a warning, emitted only when verbose output is enabled. An error is trigegred now and only for wavelengths < 1 nm.
  • Update clean.object_spct() adding parameter min.Afr that can be used to set a different target than the default of zero and in addition implement clean.object_mspct(), which was missing.

Ensure compatibility with ‘dplyr’ (1.0.0)

Some small internal changes were needed to avoid errors in calls to ‘dplyr’ methods from the upcoming version 1.0.0. From user’s perspective as ‘dplyr’ now seems to retain classes derived from tibble, it may be necessary in certain cases to disable some checks during calls to dplyr methods on spectral objects in users’ scripts. We have implemented R option “photobiology.check.spct” to allow checks to be enabled and disabled as needed. This option might be also useful for optimizing performance.


Code-breaking changes in R for photobiology

By changing the labels used for values returned by summary functions, this update can break older code. Additionally, bug fixes that correct the behaviour of irrad(), fluence(), ratio() and response(), and trim_waveband() can potentially break old code. The order in which attributes are stored has in some cases changed, and while a fixed order is not normally expected, equality tests can return FALSE for objects that are functionally identical but differ in their structure because of their vintage.


Code breaking changes in the tidyverse

Packages in the tidyverse are evolving to use package ‘vctrs’ for their implementation (see https://www.tidyverse.org/blog/ for news). ‘tibble’ (3.0.0) seems to handle row names differently than previous versions. The ‘photobiology’ code is not affected, but user code might be affected. Contrary to earlier versions, ‘tibble’ (3.0.0) retains member names in vectors, which means that "wl.colors" column created by tag() after the update to ‘tibble’ will contain named color values. ‘dplyr’ (1.0.0), not yet released, better preserves object attributes, causing some differences in the returned values, as now columns retain S3 class attributes. The use of ‘dplyr’ verb select() on spectral objects now fails, while extraction with [ and [[ works as expected as well as filter() and mutate() work correctly.


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

Please raise issues concerning bugs or enhancements to this package through Bitbucket https://bitbucket.org/aphalo/photobiology/issues

photobiology 0.9.30

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

  • Add function compare_spct() for comparisons between pairs of spectra based on summaries computed over multiple ranges of wavelengths.
  • Add utility method uncollect() for extracting all members of a collection of spectra.
  • Add utility method thin_wl() for reducing the storage size of _spct objects by removing data points in regions with only minor features.
  • Add when_measured() and when_measured<-(), where_measured() and where_measured<-(), what_measured() and what_measured<-(), how_measured() and how_measured<-() as an alternative syntax consistent with base R for setting and querying the attributes when.measured, where.measured, how.measured and what.measured used to store metadata in spectral objects and collections.
  • Add spelling synonyms for all normalization-related methods and functions like normalise() and normalise().
  • Add specialization for collections of spectra and spelling synonyms for normalized_difference_ind().
  • Slightly changed printout: Revise summary.generic_spct() to store the name of the summarized spectrum object and revise print.summary_generic_spct() to display the name of the summarized object.
  • Possibly code breaking: Revise fscale() so that by default it sets the scaled attribute only when the target value for re-scaling is equal to one.
  • Fix bug in get_attributes() methods.
  • Add parameter address to setWhereMeasured(), revise print() methods for spectra to display address when available.
  • Revise getWhereMeasured() to consistently return a data.frame, even when a geocode is missing.
  • Add function na_geocode(), a constructor for a valid geocode data frame with all fields set to NA of correct modes.
  • Revise all logic used for geocodes for consistency in returned and set values.

Some of the intermediate development versions, never submitted to CRAN, did break some code in package ‘ooacquire’. This version of ‘photobiology’ is fully compatible with the current version of ‘ooacquire’.

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

NOTE: The updated package is in CRAN.

Please raise issues concerning bugs or enhancements to this package through Bitbucket https://bitbucket.org/aphalo/photobiology/issues

ggpmisc 0.3.3

This version (0.3.3) fixes a bug in stat_poly_eq() introduced in ‘ggpmisc’ 0.3.2 and includes a minor revision to documentation.

Documentation web site at http://docs.r4photobiology.info/ggpmisc/ 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 Bitbucket https://bitbucket.org/aphalo/ggpmisc/issues.

ggpmisc 0.3.2

This version (0.3.2) adds as new features scales and statistics that help with the creation of volcano and quadrant plots, such as used with transcriptomics and metabolomics data. A few rough edges remaining in the features added in versions 0.3.0. and 0.3.1 have been polished out. Two issues raised in Bitbucket about the documentation, highlighted some incomplete explanations. These explanations have now been expanded. One important change to the documentation of statistics whose returned values may change depending on arguments is the addition of an example of the use of geom_debug() from package ‘gginnards’ showing how to print to the R console the data returned by statistics, which is the input received by the paired geometries. The User Guide needs still some work, scheduled for the next release. Package documentation is available at https://docs.r4photobiology.info/ggpmisc/ as a web site.

Plots created using the new statistics and scales are shown below. In the quadrant plot, which observations were labelled and highlighted was decided automatically based on local 2D density. Counts for each quadrant are computed on the fly. As the plot is non-the-less created using the grammar of graphics, little if any of the flexibility of ‘ggplot2’ is lost.

Quadrant plot created with packages ‘ggplot2 (3.2.1)’, ‘ggpmisc (0.3.2)’ and ‘ggrepel (0.8.1)’.

Volcano plot created with packages ‘ggplot2’, ‘ggpmisc’ and ‘ggrepel’ (very small p-values have been squished to the top edge of the plotting area).

NOTE: The new version of ‘ggpmisc’ is on its way to CRAN.

ggspectra 0.3.4

The changes from version 0.3.3-1, the current CRAN release, are:

  • Update for compatibility with code-breaking changes in ‘tidyr’ (>= 1.0.0).
  • Minor bug fixes.
  • Make autoplot.object_spct() robust to bad-input data to avoid artefacts on stacked Rfr/Afr/Tfr plots. Data are now sanitized with a warning when off-range.

Documentation web site at https://docs.r4photobiology.info/ggspectra/.

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

Please raise issues concerning bugs or enhancements to this package through Bitbucket at https://bitbucket.org/aphalo/ggspectra/issues

photobiology 0.9.29

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

  • Add clean.object_spct(), na.rm.object_spct() and na.omit.object_spct() methods, which were missing and needed for updating package ‘ggspectra’.
  • Correct small off-range error in Ler_leaf.spct data:Tfr + Rfr = 1.0028 in the worse case instead of Tfr + Rfr <= 1.

Documentation web site at http://docs.r4photobiology.info/photobiology/ includes all help pages, with output from all examples, and vignettes in HTML format.
NOTE: The updated package is in CRAN.

Please raise issues concerning bugs or enhancements to this package through Bitbucket https://bitbucket.org/aphalo/photobiology/issues

photobiologyPlants 0.4.2

The changes from version 0.4.1 the previous CRAN version are:

  • (Code breaking!) Some data objects have been renamed and consequently old scripts may need minor edits.
  • (Data changed!) Increase wavelength resolution of the spectral data.
  • Add spectral absorbance data for the photoreceptor pigments cryptochrome 1, cryptochrome 3, phototropin 1, phototropin 2 and ZTL protein.
  • Add spectral absorbance data for eight carotenoids and chlorophyll a and chlorophyll b.
  • Add spectral fluorescence emission data for chlorophyll a and chlorophyll b.
  • Fix bug in Jalter leaf optical properties data object.
  • Rebuild data objects with ‘photobiology’ 0.9.28.
  • Translate vignette to R markdown and update it.

Documentation web site at http://docs.r4photobiology.info/photobiologyplants/.

The updated package is in CRAN.

Please raise issues concerning bugs or enhancements to this package through Bitbucket at https://bitbucket.org/aphalo/photobiologyplants/issues

ggspectra 0.3.3.1

This update includes a fix for a bug affecting autoplot() methods in the case of plotting multiple spectra in the same plot. It also includes improvements to the easy of use through the addition new or enhancements to existing convenience methods and functions. The required version of ‘photobiology’ is now 0.9.28 or higher.

The changes from version 0.3.2, the current CRAN release, are:

  • Make autotitle() the recommended method and deprecate the use of ggtitle_spct(), which remains available for backwards compatibility.
  • Enhance autotitle() to optionally set the caption in addition to title and subtitle of a plot.
  • Add support for setting of the plot caption controlled with the annotations argument of autoplot() methods.
  • Add convenience functions to make easier to modify default arguments used by autoplot() methods through R options: set_annotations_default() and set_w.band_default().
  • Add support for simultaneously adding and removing annotations from the current default by accepting lists of character vectors in addition to character vectors as argument for parameter annotations in autoplot() methods.
  • Add support in multiplot() function for adding a title to the composite figure.
  • Track changes in ‘photobiology’ (>= 0.9.28) adding support for using the "how.measured" attribute in plot titles, subtitles and captions.
  • Use a compute panel function instead of a compute group function in stat_wb_label(), stat_wb_box() and stat_wl_strip(), solving a bug affecting autoplot() methods when called with multiple spectra.

The justification for renaming the ggtitle_spct() function to autotitle() is that the new name is consistent with autoplot() and autolayer() in taking an R object of a specific class as first argument and automatically extracting the information from it.

Documentation web site at https://docs.r4photobiology.info/ggspectra/.

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

Please raise issues concerning bugs or enhancements to this package through Bitbucket at https://bitbucket.org/aphalo/ggspectra/issues