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

setWhereMeasured

Set the "where.measured" attribute


Description

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

Usage

setWhereMeasured(x, where.measured, lat, lon, address, ...)

where_measured(x) <- value

## Default S3 method:
setWhereMeasured(x, where.measured, lat, lon, address, ...)

## S3 method for class 'generic_spct'
setWhereMeasured(x, where.measured = NA, lat = NA, lon = NA, address = NA, ...)

## S3 method for class 'summary_generic_spct'
setWhereMeasured(x, where.measured = NA, lat = NA, lon = NA, address = NA, ...)

## S3 method for class 'generic_mspct'
setWhereMeasured(x, where.measured = NA, lat = NA, lon = NA, address = NA, ...)

Arguments

x

a generic_spct object

where.measured, value

A one row data.frame such as returned by function geocode from package 'ggmap' for a location search.

lat

numeric Latitude in decimal degrees North

lon

numeric Longitude in decimal degrees West

address

character Human readable address

...

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 where 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). As expected passing NULL as argument for where.measured unsets the attribute.

Method for collections of spectra recycles the location information only if it is of length one.

See Also

Examples

my.spct <- sun.spct
where_measured(my.spct)
where_measured(my.spct) <- data.frame(lon = 0, lat = -60)
where_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.