Learn R Programming

hyperSpec (version 0.95)

ncol: The Number of Rows (Spectra), Columns, and Data Points per Spectrum of an hyperSpec Object)

Description

nrow yields the number of rows in x@data, i.e. the number of spectra in the hyperSpec object. ncol returns the number of columns in x@data. I.e. the number of columns with additional information to each spectrum (e.g. "x", "y", ...) + 1 (for column spc containing the spectra).

nwl returns the number of columns in x@data$spc, i.e. the length of each spectrum.

dim returns all three values in a vector.

Usage

## S3 method for class 'hyperSpec':
ncol(x)
## S3 method for class 'hyperSpec':
nrow(x)
nwl (x)
## S3 method for class 'hyperSpec':
dim(x)

Arguments

x
a hyperSpec object

Value

  • nrow, ncol, and nwl return an integer. dim return a vector of length 3.

See Also

nrow, ncol, and dim

Examples

Run this code
nrow (chondro)
ncol (chondro)
nwl  (chondro)
dim (chondro)

Run the code above in your browser using DataLab