Learn R Programming

photobiology (version 0.11.3)

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

Description

Function to set by reference the "time.unit" attribute

Usage

setTimeUnit(
  x,
  time.unit = c("second", "hour", "day", "exposure", "none"),
  override.ok = FALSE
)

Value

x

Arguments

x

a source_spct object

time.unit

character string indicating the time unit used for spectral irradiance or exposure ("second" , "day" or "exposure") or an object of class duration as defined in package lubridate.

override.ok

logical Flag that can be used to silence warning when overwriting an existing attribute value (used internally)

See Also

Other time attribute functions: checkTimeUnit(), convertThickness(), convertTimeUnit(), getTimeUnit()

Examples

Run this code
my.spct <- sun.spct
setTimeUnit(my.spct, time.unit = "second")
setTimeUnit(my.spct, time.unit = lubridate::duration(1, "seconds"))

Run the code above in your browser using DataLab