photobiology (version 0.9.30)

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

See Also

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

Examples

Run this code
# NOT RUN {
my.spct <- sun.spct
my.spct
convertTimeUnit(my.spct, "day")
my.spct

# }

Run the code above in your browser using DataCamp Workspace