Skip to contents

Function to read the "when.measured" attribute of an existing generic_spct, generic_mspct, summary_generic_spct, data.frame or a derived-class object.

Usage

getWhenMeasured(x, ...)

when_measured(x, ...)

# Default S3 method
getWhenMeasured(x, ...)

# S3 method for class 'generic_spct'
getWhenMeasured(x, as.df = FALSE, ...)

# S3 method for class 'summary_generic_spct'
getWhenMeasured(x, as.df = FALSE, ...)

# S3 method for class 'data.frame'
getWhenMeasured(x, as.df = FALSE, ...)

# S3 method for class 'generic_mspct'
getWhenMeasured(x, ..., idx = "spct.idx")

Arguments

x

a generic_spct object

...

Allows use of additional arguments in methods for other classes.

as.df

logical If TRUE return a data frame instead of a list, when the value stored in the attribute is a list.

idx

character Name of the column with the names of the members of the collection of spectra.

Value

POSIXct An object with date and time.

Methods (by class)

  • getWhenMeasured(default): default

  • getWhenMeasured(generic_spct): generic_spct

  • getWhenMeasured(summary_generic_spct): summary_generic_spct

  • getWhenMeasured(data.frame): data.frame

  • getWhenMeasured(generic_mspct): generic_mspct

Note

If x is not a generic_spct or an object of a derived class NA is returned.

The method for collections of spectra returns the a tibble with the correct times in TZ = "UTC".

Examples


when_measured(sun.spct)
#> [1] "2010-06-22 09:51:00 UTC"