tag: Tag a spectrum

Description Usage Arguments Methods (by class) Note See Also Examples

Description

Spectra are tagged by adding variables and attributes containing color definitions, labels, and a factor following the wavebands given in w.band.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
tag(x, ...)

## Default S3 method:
tag(x, ...)

## S3 method for class 'generic_spct'
tag(x, w.band = NULL,
  wb.trim = getOption("photobiology.waveband.trim", default = TRUE),
  use.hinges = TRUE, short.names = TRUE, byref = FALSE, ...)

## S3 method for class 'generic_mspct'
tag(x, w.band = NA,
  wb.trim = getOption("photobiology.waveband.trim", default = TRUE),
  use.hinges = TRUE, short.names = TRUE, byref = FALSE, ...)

Arguments

x

an R object

...

not used in current version

w.band

waveband or list of waveband objects The waveband(s) determine the region(s) of the spectrum that are tagged

wb.trim

logical Flag telling if wavebands crossing spectral data boundaries are trimmed or ignored

use.hinges

logical Flag indicating whether to use hinges to reduce interpolation errors

short.names

logical Flag indicating whether to use short or long names for wavebands

byref

logical Flag indicating if new object will be created by reference or by copy of x

Methods (by class)

  • default: Default method for generic

  • generic_spct: Tag one of generic_spct, and derived classes including source_spct, filter_spct, reflector_spct, object_spct, and response_spct.

  • generic_mspct: Tag one of generic_mspct, and derived classes including source_mspct, filter_mspct, reflector_mspct, object_mspct, and response_mspct.

Note

NULL as w.band argument does not add any new tags, instead it removes existing tags if present. NA, the default, as w.band argument removes existing waveband tags if present and sets the wl.color variable. If a waveband object or a list of wavebands is supplied as argument then tagging is based on them, and wl.color is also set.

See Also

Other tagging and related functions: is_tagged, untag, wb2rect_spct, wb2spct, wb2tagged_spct

Examples

1
2
tag(sun.spct)
tag(sun.spct, list(A = waveband(c(300,3005))))


Search within the photobiology package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.