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

setWhenMeasured

Set the "when.measured" attribute


Description

Function to set by reference the "when" attribute of an existing generic_spct or an object of a class derived from generic_spct.

Usage

setWhenMeasured(x, when.measured, ...)

when_measured(x) <- value

## Default S3 method:
setWhenMeasured(x, when.measured, ...)

## S3 method for class 'generic_spct'
setWhenMeasured(x, when.measured = lubridate::now(tzone = "UTC"), ...)

## S3 method for class 'summary_generic_spct'
setWhenMeasured(x, when.measured = lubridate::now(tzone = "UTC"), ...)

## S3 method for class 'generic_mspct'
setWhenMeasured(x, when.measured = lubridate::now(tzone = "UTC"), ...)

Arguments

x

a generic_spct object

when.measured, value

POSIXct to add as attribute, or a list of POSIXct.

...

Allows use of additional arguments in methods for other classes.

Value

x

Methods (by class)

  • default: default

  • generic_spct: generic_spct

  • summary_generic_spct: summary_generic_spct

  • generic_mspct: generic_mspct

Note

This method alters x itself by reference and in addition returns x invisibly. If x is not a generic_spct or an object of a class derived from generic_spct, x is not modified. If when is not a POSIXct object or NULL an error is triggered. A POSIXct describes an instant in time (date plus time-of-day plus time zone).

See Also

Examples

my.spct <- sun.spct
when_measured(my.spct)
when_measured(my.spct) <- lubridate::ymd_hms("2020-01-01 08:00:00")
when_measured(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.