Learn R Programming

hyperSpec (version 0.95)

dimnames: Dimnames of an hyperSpec Object

Description

rownames yields the names of the rows (spectra) of a hyperSpec object, colnames the names of the data colums, and dimnames both together with the names of the wavelengths (see below).

Usage

## S3 method for class 'hyperSpec':
colnames(x, do.NULL = TRUE, prefix = "col")
## S3 method for class 'hyperSpec':
rownames(x, do.NULL = TRUE, prefix = "row")
## S3 method for class 'hyperSpec':
dimnames(x)

Arguments

x
a hyperSpec object
do.NULL, prefix
handed to rownames and colnames, respectively.

Value

  • rownames and colnames return an character vector, dimames returns a list with elements row, data, wl with the respective character vectors.

Details

dimnames returns in element wl the colnames of the spectra matrix, not the values.

The replacement functions for column and row names are used like: colnames (x) <- value rownames (x) <- value

If changing the colnames, be careful not to touch spc. Otherwise an error about an invalid hyperSpec object results.

See Also

rownames, colnames, and dimnames

rownames<- and colnames<- for the replacement functions

wl, wl<- for accessing the values of the wavelength axis.

Examples

Run this code
rownames (flu)
colnames (flu)
dimnames (laser)

rownames (flu) <- paste ("sample", LETTERS [1 : 6])
flu$..

Run the code above in your browser using DataLab