The new version is mostly an update of the package internals. This is a thorough overhaul to eliminate dependency on package
data.table. Using this package with relatively small data objects did not provide any performance advantage but made the use of non-standard semantics and syntax a rather heavy burden. Package
data.table does not seem to have been designed with the derivation of new classes in mind and this made programming quite difficult.
How much will this change affect user code? Old objects are fully compatible, but any code that had relied on use of
data.table‘s indexing syntax will not work any longer. However, such code was not very useful with spectra as it returned objects with this package’s classes and other attributes stripped off. Package
data.table can still be used in the same scripts, but if a
data.table object is converted into an spectral object, it will no longer inherit from class
Another change that will affect results of calculations is that the code has been revised so as to reduce rounding errors, specially during integration. This means that returned values are slightly different than in earlier versions. However, the first three or four significant digits should remain unchanged.
Deriving spectral classes directly from
data.frame instead of
data.table made it easy to write wrappers on R’s Extract and Replace indexing functions. This provides a visible change to users, as now indexing with
[ works as expected and safely with objects of all the spectral classes. Also replacement semantics, with the indexed spectrum on the ‘left side’ being assigned to is supported.
As we relied earlier on
data.table for printing the spectral objects, a new
print() method which follows the one in package
dplyr is now provided. It differs from the print method in
dplyrin that it prints additional information about the spectral objects, including their class.
photobiology does no longer litter the user environment with imports. If users have earlier relied on loading the
photobiology package to have functions from packages
lubridate available, they will need to add to their scripts explicit calls to
library() to load them. This is just respecting the recommended good practice of hiding as many names as possible, so as to avoid name clashes with other packages or user written code.
Vignettes were also updated for the new semantics, replacing a few uses of
data.table syntax for indexing and eliminating, no longer needed, explicit copy statements. The User Guide was significantly shortened, removing all redundant code examples.
A few remaining bugs in old code were squashed. The new code has been thoroughly tested, but as in any big code overhaul, it is likely that some new bugs have been introduced. If you find any bug, old or new, please, do report them to me! All testing has been done under R 3.2.1, so now R >= 3.2.0 is required.
The internals of this package used
data.table syntax in a few places, or had to take special steps due to the copy by reference syntax of spectral objects in previous versions. The code internals were updated to work with the new version of package
photobiology. The vignettes were updated. No user-visible changes in functionality were made.
The internals of this package used
data.table syntax and had to be updated. The code was also simplified by use of functions from package
dplyr. No user-visible changes in functionality were made.
photobiologyAll 0.3.1, photobiologyFilters 0.3.1, photobiologyLamps 0.3.2, photobiologyLEDs 0.3.1, photobiologyPlants 0.3.1, photobiologyReflectors 0.3.1, photobiologySensiors 0.3.1, photobiologySun 0.3.1
These packages required only minor, or no changes to the vignette and code, but the data objects had to be rebuilt with the new version of package
photobiology and the dependency on package
photobiology updated to the current version.
Updated version dependencies and added the definition for the ICNIRP BSWF used for assessing health risks involved in UV exposure.
BACKWARDS COMPATIBILITY: Changes are not 100% backwards compatible, but should be of moderate consequences to most users.
NOTE: Sources, and Windows binaries only for R 3.2.x, are now available in the repository.