/
README.Rmd
147 lines (103 loc) · 5.61 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---
output:
github_document:
html_preview: TRUE
---
```{r readme-01, echo = FALSE}
knitr::opts_chunk$set(
fig.asp = 2/3,
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# photobiologySensors <img src="man/figures/logo.png" align="right" width="120" />
<!-- badges: start -->
[![CRAN version](https://www.r-pkg.org/badges/version-last-release/photobiologySensors)](https://cran.r-project.org/package=photobiologySensors) [![cran checks](https://badges.cranchecks.info/worst/photobiologySensors.svg)](https://cran.r-project.org/web/checks/check_results_photobiologySensors.html) [![R build status](https://github.com/aphalo/photobiologySensors/workflows/R-CMD-check/badge.svg)](https://github.com/aphalo/photobiologySensors/actions)
<!-- badges: end -->
Package **photobiologySensors** is a collection of spectral responsiveness data
for different broadband sensors and of angular response data for some of the
same sensors and for cosine diffusers and other entrance optics used with
spectrometers. It complements other packages in the suite of R packages for
photobiology 'r4photobiology'. This package contains only data.
## Code breaking renaming of data objects
In the update to version 0.5.0 several members of the collection of filter
spectra were renamed to ensure consistency and clarity. As of version 0.5.0 all
member names start with the name of the manufacturer or supplier. In addition,
several of the vectors of names of member spectra were renamed to include the
word "sensors" to avoid possible name clashes with other packages and also to
improve naming consistency.
## Examples
```{r example-02, message=FALSE}
library(photobiologySensors)
eval_ggspectra <- requireNamespace("ggspectra", quietly = TRUE)
if (eval_ggspectra) library(ggspectra)
```
How many spectra are included in the current version of 'photobiologyFilters'?
```{r example-03}
length(sensors.mspct)
```
What are the names of available spectra? We use `head()` to limit the output.
```{r example-04}
# list names of the first 10 sensors
head(names(sensors.mspct), 10)
```
To subset based on different criteria we can use predefined character vectors of filter names. For example, vector `licor_sensors` lists the names of the spectra for sensors from LI-COR.
```{r example-05}
kipp_sensors
```
We can use the vector to extract all these spectra as a collection, or as show
below, extract data for PAR sensors from Kipp.
```{r example-05a}
sensors.mspct[intersect(kipp_sensors, par_sensors)]
```
Please, see the _User Guide_ or help pages for the names of other vectors of
names by supplier, wavelength region and of the spectrum.
Summary calculations can be easily done with methods from package
'photobiology'. Here we calculate mean photon response for two regions of the
spectrum delimited by wavelengths in nanometres. Roughly 99% of the photons
sensed by this sensor are within PAR.
```{r example-06}
q_response(sensors.mspct[["LICOR_LI_190R"]],
list(waveband(c(400, 700)), waveband(c(700, 800))),
quantity = "contribution")
```
The `autoplot()` methods from package 'ggspectra' can be used for plotting one
or more spectra at a time. The classes of the objects used to store the spectral
data are derived from `"data.frame"` making direct use of the data easy with
functions and methods from base R and various packages.
```{r example-07, eval=eval_ggspectra}
autoplot(sensors.mspct[["LICOR_LI_190R"]])
```
## Installation
Installation of the most recent stable version from CRAN:
```{r, eval=FALSE}
install.packages("photobiologySensors")
```
Installation of the current unstable version from Bitbucket:
```{r, eval=FALSE}
# install.packages("devtools")
remotes::install_github("aphalo/photobiologySensors")
```
## Documentation
HTML documentation is available at (https://docs.r4photobiology.info/photobiologyFilters/), including a _User Guide_.
News on updates to the different packages of the 'r4photobiology' suite are regularly posted at (https://www.r4photobiology.info/).
Two articles introduce the basic ideas behind the design of the suite and its use:
Aphalo P. J. (2015) (https://doi.org/10.19232/uv4pb.2015.1.14) and Aphalo P. J. (2016) (https://doi.org/10.19232/uv4pb.2016.1.15).
A book is under preparation, and the draft is currently available at (https://leanpub.com/r4photobiology/).
A handbook written before the suite was developed contains useful information on the quantification and manipulation of ultraviolet and visible radiation:
Aphalo, P. J., Albert, A., Björn, L. O., McLeod, A. R., Robson, T. M., & Rosenqvist, E. (Eds.) (2012) Beyond the Visible: A handbook of best practice in plant UV photobiology (1st ed., p. xxx + 174). Helsinki: University of Helsinki, Department of Biosciences, Division of Plant Biology. ISBN 978-952-10-8363-1 (PDF), 978-952-10-8362-4 (paperback). PDF file available from (https://hdl.handle.net/10138/37558).
## Support
Use (https://stackoverflow.com/questions/tagged/r4photobiology) to access existing questions and answers.
(https://stackoverflow.com/) using tag [r4photobiology] plus any other relevant tag to ask new questions.
## Bug reports and suggestions for enhancements
(https://github.com/aphalo/photobiologySensors/issues)
## Contributing
Pull requests, bug reports, and feature requests are welcome at (https://github.com/aphalo/photobiologySensors).
## Citation
If you use this package to produce scientific or commercial publications, please cite according to:
```{r}
citation("photobiologySensors")
```
## License
© 2012-2023 Pedro J. Aphalo (pedro.aphalo@helsinki.fi). Released under the GPL, version 2 or greater. This software carries no warranty of any kind.