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

Share with

Leave a Reply