Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

convertTimeUnit

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


Description

Function to set the "time.unit" attribute and simultaneously rescaling the spectral data to be expressed using the new time unit as basis of expression. The change is done by reference ('in place').

Usage

convertTimeUnit(x, time.unit = NULL, ...)

Arguments

x

source_spct or response_spct object

time.unit

a character string, either "second", "hour", "day", "exposure" or "none", or a lubridate::duration

...

(currently ignored)

Value

x possibly with the time.unit attribute modified

Note

if x is not a source_spct or a response_spct object, or time.unit is NULL x is returned unchanged, if the existing or new time.unit cannot be converted to a duration, then the returned spectrum will contain NAs.

See Also

Other time attribute functions: checkTimeUnit(), convertTfrType(), convertThickness(), getTimeUnit(), setTimeUnit()

Examples

my.spct <- sun.spct
my.spct
convertTimeUnit(my.spct, "day")
my.spct

photobiology

Photobiological Calculations

v0.10.10
GPL (>= 2)
Authors
Pedro J. Aphalo [aut, cre] (<https://orcid.org/0000-0003-3385-972X>), Titta K. Kotilainen [ctb] (<https://orcid.org/0000-0002-2822-9734>), Glenn Davis [ctb], Agnese Fazio [ctb]
Initial release
2022-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.