Learn R Programming

⚠️There's a newer version (0.12.0) of this package.Take me there.

Package photobiology is a set of tools designed to facilitate photobiology-related data analysis and simulation. It is the core a suite of packages with additional packages providing support for plotting spectra with pacakge 'ggplot2', example data sets and definitions that are specific to certain subject areas.

We have attempted to keep a good balance between fast computation, easy to maintain code, and a clear interface. The package has in addition to user-friendly methods and objects, also functions optimized for raw performance.

This suite of R packages started as a rewrite of the package UVcalc that was developed as a companion to a handbook of methods in plant UV photobiology writen within the COST Action FA0906 UV4growth.

The programming has been done until now by Pedro J. Aphalo, but the information used was collected, discussed and evaluated in many cases by other contributors to the handbook and by researchers in academy and industry.

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 http://hdl.handle.net/10138/37558

Please, see the web site R4Photobiology for details on other packages available as part of the suite, and on how to install them.

The current release of photobiology is available through CRAN for R (>= 3.2.0).

Copy Link

Version

Install

install.packages('photobiology')

Monthly Downloads

649

Version

0.9.8

License

GPL (>= 3)

Maintainer

Pedro Aphalo

Last Published

May 19th, 2016

Functions in photobiology (0.9.8)

MathFun

Miscellaneous Mathematical Functions
day_night

Times for sun positions
ciexyzCMF10.spct

Linear energy CIE xyz colour matching function (CMF) 10 deg data
Extract

Extract or replace parts of a spectrum
plus-.generic_spct

Arithmetic Operators
reflectance_spct

Calculate reflectance from spectral reflectance
setTimeUnit

Set the "time.unit" attribute of an existing source_spct object
rgb_spct

RGB color values
cps2irrad

Conversion from counts per second to physical quantities
sun.data

Solar spectral irradiance (simulated)
e_irrad

Energy irradiance
as_quantum_mol

Convert spectral energy irradiance into spectral photon irradiance
check_spct

Check validity of spectral objects
photon_ratio

Photo:photon ratio
trim_wl

Trim head and/or tail of a spectrum
log

Logarithms and Exponentials
interpolate_spct

Map a spectrum to new wavelength values.
print.waveband

Print a "waveband" object
checkMspctVersion

Check that the "mspct.version" attribute is set
clip_wl

Clip head and/or tail of a spectrum
convolve_each

Convolve function for collections of spectra
copy_attributes

Copy attributes
T2A

Convert transmittance into absorbance.
ciexyzCC10.spct

CIE xyz chromaticity coordinates (CC) 10 deg data
as.generic_spct

Spectral-object copy constructor
e2qmol_multipliers

Calculate energy to quantum (mol) multipliers
subset2mspct

Convert 'long' or tidy spectral data into a collection of spectra
transmittance

Transmittance
ciexyzCC2.spct

CIE xyz chromaticity coordinates 2 deg data
date2tod

Convert date to time-of-day in hours
clear.spct

Theoretical spectrum of a clear clear material
is.waveband

Query if it is a waveband
Trig

Trigonometric Functions
is_tagged

Query if it is an spectrum is tagged
calc_source_output

Light-source spectral output
clean_spct

Clean a spectrum
absorptance_spct

Calculate absorptance from spectral absorptance.
date2seconds

date argument check and conversion
getRfrType

Get the "Rfr.type" attribute
peaks

Peaks or local maxima
find_peaks

Find peaks in a spectrum
div_spectra

Divide two spectra, even if the wavelengths values differ
trim_waveband

Trim (or expand) head and/or tail
f_dispatcher_spct

Math function dispatcher for spectra
getBSWFUsed

Get the "bswf.used" attribute
get_peaks

Get peaks and valleys in a spectrum
fscale

Rescale a spectrum using a summary function
getWhatMeasured

Get the "what.measured" attribute
fluence

Fluence
fscale_spct

fscale a spectrum
irrad

Irradiance
fshift_spct

fshift a spectrum
normalized_diff_ind

Calculate a normalized index.
integrate_spct

Integrate spectral data.
e_response

Energy-based photo-response
is.generic_spct

Query class of spectrum objects
A2T

Convert absorbance into transmittance
msmsply

Multi-spct transform methods
D2_spectrum

Calculate deuterim lamp output spectrum from fitted constants
is_photon_based

Query if a spectrum contains photon- or energy-based data.
is.generic_mspct

Query class of spectrum objects
beesxyzCMF.spct

Honeybee xyz chromaticity colour matching function data
l_insert_hinges

Insert wavelength values into spectral data.
absorptance

Absorptance
opaque.spct

Theoretical spectrum of an opaque material
black_body.spct

Theoretical black body
max

Wavelength maximum
resp_spct

Calculate response from spectral response
photons_energy_ratio

Photon:energy ratio
average_spct

Average spectral data.
calc_multipliers

Spectral weights
e_fluence

Energy fluence
rbindspct

Row-bind spectra
class_spct

Query which is the class of an spectrum
filter_cps.mspct

Counts per second from a measurement of a plastic film
ccd.spct

Spectral response of a back-thinned CCD image sensor.
generic_mspct

Collection-of-spectra constructor
setRfrType

Set the "Rfr.type" attribute
checkTimeUnit

Check the "time.unit" attribute of an existing source_spct object
energy_irradiance

Calculate (energy) irradiance from spectral irradiance
energy_ratio

Energy:energy ratio
as.generic_mspct

Collection-of-spectra copy-constructor
range

Wavelength range
print

Print a spectral object
getInstrDesc

Get the "instr.desc" attribute
q_irrad

Photon irradiance
getWhenMeasured

Get the "when.measured" attribute
setInstrSettings

Set the "instr.settings" attribute
defunct

Defunct functions and methods
yellow_gel.spct

Transmittance spectrum of yellow theatrical gel.
setScaled

Set the "scaled" attribute
sun.spct

Solar spectral irradiance (simulated)
mod-.generic_spct

Arithmetic Operators
mspct_classes

Names of multi-spectra classes
split2mspct

Convert a 'wide' or untidy data frame into a collection of spectra
div-.generic_spct

Arithmetic Operators
setInstrDesc

Set the "instr.desc" attribute
setWhatMeasured

Set the "what.measured" attribute
reflectance

Reflectance
FEL_spectrum

Incandescent "FEL" lamp emission spectrum
getSpctVersion

Get the "spct.version" attribute
rmDerivedMspct

Remove "generic_mspct" and derived class attributes.
setMultipleWl

Set the "multiple.wl" attribute
merge.generic_spct

Merge two generic_spct objects
sign

Sign
oper_spectra

Binary operation on two spectra, even if the wavelengths values differ
valleys

Valleys or local minima
wb2tagged_spct

Create tagged spectrum from wavebands
is_effective

Is an R object "effective"
D65.illuminant.spct

CIE D65 illuminant data
split_photon_irradiance

Photon irradiance for split spectrum regions
slash-.generic_spct

Arithmetic Operators
split_bands

List-of-wavebands constructor
altitude

function to be numerically minimized
as_energy

Convert spectral photon irradiance into spectral energy irradiance
summary_spct_classes

Function that returns a vector containing the names of spectral summary classes.
clear_photobio.cache

clear the spectral weights cache
normalization

Normalization of an R object
photobiology-package

'Photobiological' Calculations
v_insert_hinges

Insert wavelength values into spectral data.
untag

Remove tags
w_length_range2rgb

Wavelength range to rgb color conversion
convertTimeUnit

Convert the "time.unit" attribute of an existing source_spct object
c.generic_mspct

Combine collections of spectra
getInstrSettings

Get the "instr.settings" attribute
photon_irradiance

Photon irradiance
photodiode.spct

Spectral response of a GaAsP photodiode
fshift

Shift the scale of a spectrum using a summary function
getTfrType

Get the "Tfr.type" attribute
getTimeUnit

Get the "time.unit" attribute of an existing source_spct object
q2e

Convert photon-based quantities into energy-based quantities
absorbance

Absorbance
setBSWFUsed

Set the "bswf.used" attribute
getScaled

Get the "scaled" attribute
q_ratio

Photon:photon ratio
rmDerivedSpct

Remove "generic_spct" and derived class attributes.
shared_member_class

Classes common to all collection members.
normalize

Normalize spectral data
is_scaled

Query whether a generic spectrum has been scaled
check_w.length

Sanity check of wavelengths (internal function).
qe_ratio

Photon:energy ratio
^.generic_spct

Arithmetic Operators
getWhereMeasured

Get the "where.measured" attribute
sun.daily.spct

Daily solar spectral irradiance (simulated)
ciev2.spct

Linear energy CIE 2008 luminous efficiency function 2 deg data
e2q

Convert energy-based quantities into photon-based quantities.
transmittance_spct

Calculate transmittance from spectral transmittance.
setTfrType

Set the "Tfr.type" attribute
source_spct

Spectral-object constructor
q_response

Photon-based photo-response
sun.daily.data

Daily solar spectral irradiance (simulated)
tag

Tag a spectrum
getMultipleWl

Get the "multiple.wl" attribute
polyester.spct

Transmittance spectrum of clear polyester film
prod_spectra

Multiply two spectra, even if the wavelengths values differ
minus-.generic_spct

Arithmetic Operators
is_normalized

Query whether a generic spectrum has been normalized.
clear_body.spct

Theoretical clear body
trim_spct

Trim (or expand) head and/or tail
integrate_xy

Gives irradiance from spectral irradiance.
color

Color of an object
checkSpctVersion

Check that the "spct.version" attribute is set
stepsize

Stepsize
spread

Length of object in wavelength units
sum_spectra

Add two spectra
interpolate_wl

Map spectra to new wavelength values.
smooth_spct

Smooth a spectrum
split_irradiance

Energy or photon irradiance for split spectrum regions
summary

Summary of a spectral object
interpolate_spectrum

Calculate spectral values at a different set of wavelengths
is.old_spct

Query if an object has old class names
upgrade_spct

Upgrade one spectral object
twilight2angle

twilight argument check and conversion
w_length2rgb

Wavelength to rgb color conversion
sun_angles

Solar angles
is.summary_generic_spct

Query class of spectrum summary objects
labels

Find labels from "waveband" object
waveband

Waveband constructor method
time2seconds

time argument check and conversion
min

Wavelength minimum
is_absorbance_based

Query if a spectrum contains absorbance or transmittance data
white_body.spct

Theoretical white body
s_e_irrad2rgb

Spectrum to rgb color conversion
waveband_ratio

Photon or energy ratio
setWhenMeasured

Set the "when.measured" attribute
setNormalized

Set the "normalized" attribute
wb2rect_spct

Create tagged spectrum from wavebands
wb2spct

Create spectrum from wavebands
clean

Clean (=replace) off-range values in a spectrum
dim.generic_mspct

Dimensions of an Object
e2quantum_multipliers

Calculate energy to quantum multipliers
getMspctVersion

Get the "mspct.version" attribute
insert_spct_hinges

Insert new wavelength values into a spectrum
normalize_range_arg

Normalize a range argument into a true numeric range
response

Integrated response
setWhereMeasured

Set the "where.measured" attribute
subt_spectra

Subtract two spectra
times-.generic_spct

Arithmetic Operators
absorbance_spct

Calculate absorbance from spectral absorbance.
A.illuminant.spct

CIE A illuminant data
as_quantum

Convert spectral energy irradiance into spectral photon irradiance
check_spectrum

Sanity check of a spectrum.
ciev10.spct

Linear energy CIE 2008 luminous efficiency function 10 deg data
ciexyzCMF2.spct

Linear energy CIE xyz colour matching function (CMF) 2 deg data
e_ratio

Energy:energy ratio
eq_ratio

Energy:photon ratio
Extract_mspct

Extract or replace members of a collection of spectra
getNormalized

Get the "normalized" attribute
insert_hinges

Insert wavelength values into spectral data.
irradiance

Photon (quantum) irradiance from spectral (energy) irradiance.
midpoint

Central wavelength value
q_fluence

Photon fluence
print.summary_generic_spct

Print spectral summary
setGenericSpct

Convert an R object into a spectrum object.
round

Rounding of Numbers
spct_classes

Function that returns a vector containing the names of spectra classes.
split_energy_irradiance

Energy irradiance for split spectrum regions
trim_tails

Trim (or expand) head and/or tail
upgrade_spectra

Upgrade one or more spectral objects