R: Coerce to a collection-of-spectra

as.source_mspct {photobiology} | R Documentation

## Coerce to a collection-of-spectra

### Description

Return a copy of an R object with its class set to a given type of spectrum.

### Usage

    as.source_mspct(x, ...)

    ## Default S3 method:
    as.source_mspct(x, ...)

    ## S3 method for class 'data.frame'
    as.source_mspct(x, time.unit = c("second", "day",
      "exposure"), bswf.used = c("none", "unknown"),
      strict.range = getOption("photobiology.strict.range", default = FALSE), ...)

    ## S3 method for class 'source_spct'
    as.source_mspct(x, ...)

    ## S3 method for class 'list'
    as.source_mspct(x, time.unit = c("second", "day", "exposure"),
      bswf.used = c("none", "unknown"),
      strict.range = getOption("photobiology.strict.range", default = FALSE), ...,
      ncol = 1, byrow = FALSE)

    ## S3 method for class 'matrix'
    as.source_mspct(x, w.length, spct.data.var = "s.e.irrad",
      multiplier = 1, byrow = NULL, spct.names = "spct_", ...)

### Arguments

`x` | a list of spectral objects or a list of objects such as data frames that can be converted into spectral objects.
`...` | passed to individual spectrum object constructor
`time.unit` | character A string, "second", "day" or "exposure"
`bswf.used` | character
`strict.range` | logical Flag indicating how off-range values are handled
`ncol` | integer Number of 'virtual' columns in data
`byrow` | logical If `ncol > 1` how to read in the data
`w.length` | numeric A vector of wavelengthvalues sorted in strictly ascending order (nm).
`spct.data.var` | character The name of the variable that will contain the spectral data. This indicates what physical quantity is stored in the matrix and the units of expression used.
`multiplier` | numeric A multiplier to be applied to the values in `x` to do unit or scale conversion.
`spct.names` | character Vector of names to be assigned to collection members, either of length 1, or with length equal to the number of spectra.

### Value

A copy of `x` converted into a `source_mspct` object.

### Methods (by class)

- `default`:

- `data.frame`:

- `source_spct`:

- `list`:

- `matrix`:

### Note

When `x` is a square matrix an explicit argument is needed for `byrow` to indicate how data in `x` should be read. In every case the length of the `w.length` vector must match one of the dimensions of `x`.

### See Also

Other Coercion methods for collections of spectra: `as.calibration_mspct`, `as.chroma_mspct`, `as.cps_mspct`, `as.filter_mspct`, `as.generic_mspct`, `as.object_mspct`, `as.raw_mspct`, `as.reflector_mspct`, `as.response_mspct`, `split2mspct`, `subset2mspct`

[Package photobiology version 0.9.21 Index]