My book on R was published on 28 July 2020. The R package ‘learnrbook’ available through CRAN contains data and the R code scripts and chunks from the book. The book has now its own website.
In the book’s website you will find free supplementary chapters as downloadable PDF files and other material complementing the book.
This non-code-breaking update brings a few new features and tracks deprecations in package ‘tidyr’.
The main changes from version 0.4.23 the previous CRAN release, are:
- Replace use of deprecated
- Add function
read_cid_spectravue_csv() supporting data import from measurements CSV files output by CID Bio-Science’s SpectraVue CI-710s leaf spectrometer.
- Add function
read_foreign2mspct() to apply an import function to a list of files.
- Add color-related functions
expect_SSI() implemented as wrappers to functions in package ‘colorSpec’. These functions accept
source_spct objects as arguments. CRI, CCT and SSI are quantities used to describe light used for illumination, photography, cinematography and video.
- 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://github.com/aphalo/photobiologyinout/issues
This is a major and code-breaking update. Naming conventions have been changed and several new spectra have been added. Previously included spectra have in most cases been recomputed and may slightly differ from earlier versions of the same data. In part this was done to reduce the size of the data objects, making it possible to include more spectra while keeping the size of the package reasonable. The number of spectra is more than 100, including several of the newest high CRI LEDs as well as some recent types for horticulture.
The main changes from version 0.4.2, the current CRAN release, are:
- Revise for ‘ggspectra’ (>= 0.3.1).
- Rebuild all data objects with ‘photobiology’ (== 0.10.10) taking care that all spectra in
leds.mspct are normalized.
- Apply function
photobiology::thin_wl() to all spectra to reduce their stored size.
- Add data for addtional LED types and update the metadata of most of those carried over from earlier versions.
- Add lists of LEDs by intended use.
- CODE BREAKING: change naming convention for members of the collection of spectra. Now names consist of “brand” and type.
- CODE BREAKING: lists of LEDs by colour are now based on the wavelength at the peak of emission. We use ISO-standard wavelength boundaries for colours of visible radiation, except for purple < 400 nm. For ultraviolet we follow ISO. All broad-spectrum LEDs are listed as white.
- Rewrite/revise all scripts used to prepare the spectral data.
- Migrate Git repository from Bitbucket to GitHub.
Documentation web site at http://docs.r4photobiology.info/photobiologyLEDs/.
NOTE: The updated package has been submitted to CRAN.
Please raise issues concerning bugs or enhancements to this package through Bitbucket at https://github-com/aphalo/photobiologyLEDs/issues
A handbook on how to do calculations used in photobiological research with R has been under preparation for a long time. An 80% complete version has been available through LeanPub for several years. The book describes the use of our suite of R packages and also of functions from base R and a few other packages available through CRAN. I (Pedro J. Aphalo) am the lead author, while Andreas Albert, T. Matthew Robson and Titta Kotilainen have contributed text and examples and feedback.
Although we haven’t had time to finish writing the book, I have been checking that the code examples work with current versions of R and packages. Rather recently I made small edits to a few code chunks that had stopped working and uploaded the new version of the PDF file to LeanPub.
Some minutes ago I tried to build all examples with R 4.2.o, a major update to R released some days ago. R 4.2.o contains a bug, that unluckily prevents a couple some examples in the book from running under MS-Windows. The already available patched version of R 4.2.0 solves this problem. Anyway, this bug affects only a very specific use related to data acquisition.
The book is sold for the amount the buyer wishes to pay, including getting it for free.
For Windows users the most significant changes are that now the binary distribution contains only a 64 bit executable. A new build chain is used and Rtools 4.2 is required to build from sources packages that include C, C++ or FORTRAN code. As is always the case, all CRAN packages are tested on CRAN itself.
Relevant to all operating systems the recently added pipe oprerator (
|>) now supports the use of the underscore (
_) as a placeholder on the rhs of the operator.
1:10 |> mean() |> round()
1:10 |> mean(x = _) |> round(x = _)
These two statements are equivalent, but
_ makes it possible to pipe by name the value returned by the lhs into any parameter on the rhs.
There are also some improvements to the ‘grid’ package adding flexibility to pattern and gradient fills and masks, which are recently added features. They are yet to be well supported by ‘ggplot2’.