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

photobiologyFilters 0.5.1

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

The main changes from version 0.5.0, the current CRAN version, released 10 months ago are:

New

  • Add filter.properties metadata when available, supporting convertTfrType() and convertThickness() functions available in ‘photobiology’ (>= 0.10.2).
  • Add data for Heliopan UVIR-cut “Digital” filter.
  • Add data for Fotga UV IR CUT filter.
  • Add refractive_index.mspct with spectral data for 15 materials.
  • Revise the User Guide.

Fixed

  • Correct wrong spelling of Tangsinuo Technologies in two filters’ names and documentation.

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/photobiologyfilters/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

ggspectra 0.3.6

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

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

New

  • Support for computation of colors using other chromaticity coordinates than the color matching function (CMF) for human vision.
  • stat_spikes(), useful for highlighting and labeling spikes in spectra.
  • Fitted peaks and valleys (experimental).
  • Annotations "wls" and "wls.labels" in autoplot() methods.
  • Update decoration() to support "wls" and "wls.labels".
  • Compatibility with ‘dplyr’ (>= 1.0.0).
  • Track changes in ‘photobiology’ 0.10.1 and 0.10.2.

Bugs fixed

  • Fix two bugs in ggplot() method for class object_spct.

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.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

photobiologyInOut 0.4.22

The main changes from version 0.4.21-1 the previous CRAN release, are:

  • Revise read_fmi2mspct() adding flexibility to cope with variation in date and time formats used in headers of spectra.
  • Update for compatibility with ‘tibble’ (>= 3.0.0).
  • Update for compatibility with ‘photobiology’ (>= 0.10.0) which also provides compatibility with ‘dplyr’ (>= 1.0.0).
  • Depends now on ‘photobiology’ (>= 0.10.0).

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

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 https://bitbucket.org/aphalo/photobiologyinout/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

ggspectra 0.3.5

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

  • Track changes in ‘photobiology’ 0.9.30 to the value returned by getWhereMeasured() which could in very specific cases trigger errors.
  • Revise ggplot() methods so that the class and attributes of spectral objects are retained in the data member of the gg object. This allows use of methods
    specific to spectra in data transformations in pipes passed as arguments to the data parameter of layer functions.

Example of what is now possible:

library(ggspectra)
library(dplyr)
library(rlang)

ggplot(sun.spct) +
  geom_line() +
  geom_line(data = . %>% smooth_spct(method = "supsmu"),
            colour = "red", size = 1.2)

Note: When mapping is done within ggplot(), layer functions only “see” a data frame with variables according to aesthetics. This means that smooth_spct() cannot be used as a method in stat_smooth().

Plot

Plot returned by the code above.

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

photobiologyInOut 0.4.21-1

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

  • Minor revision to documentation.
  • Update test cases for compatibility with ‘photobiology’ (>= 0.9.30) (to prevent benign CRAN check failure).

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

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 https://bitbucket.org/aphalo/photobiologyinout/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