colorSpecis used to construct colorSpec objects.
is.colorSpec tests whether an object is a valid colorSpec object.
colorSpec( data, wavelength, quantity='auto', organization='auto' )is.colorSpec(x)
datais a vector, there is a single spectrum and the number of points in that spectrum is the length of the vector. In case
datais a matrix, the spectra are stored in the columns, so the number of points in each spectrum is the number of rows. It is OK for the matrix to have only 0 or 1 column. The column names (if any) are taken as the spectrum names. If no names are given, or if there are duplicate names, then
'S1', 'S2', ...are used. Names can also be assigned after construction too; see
specnames. Row names are ignored. Compare this function with ts.
NROW(data). The sequence must be increasing.
quantityof all spectra; see
quantityfor a list of possible values. In case of
'auto', a guess is made from the column names. This guess can be overridden later.
'auto', the organization is
data. Other possible organizations are
'df.row'. The organization can be changed later, see
organizationfor discussion of all 4 possible organizations.
colorSpecreturns a colorSpec object, or
NULLin case of ERROR.
FALSEit logs helpful reasons that
data.frame. It is of S3 class
'colorSpec'with these extra attributes:
df.col, then this is absent.
quantityfor a list of possible values.
'date'are already reserved; see
'vector', in which case it is equal to the single character string name of the single spectrum. See
product. It is a list of the colorSpec terms in this product.
# make a synthetic Gaussian bandpass filter center = 600 wave = 400:700 trans = exp( -(wave-center)^2 / 20^2 ) filter.bp = colorSpec( trans, wave, 'transmittance' ) organization( filter.bp ) # returns:  "vector" specnames( filter.bp ) = "myfilter" # and now plot it plot( filter.bp )