Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dimensions

Retrieve dimensions of Spectra* objects


Description

Retrieves the wavelengths units and the spectral resolution from Spectra* objects.

Usage

## S3 method for class 'Spectra'
length(x)

## S4 method for signature 'Spectra'
nrow(x)

## S4 method for signature 'Spectra'
ncol(x)

## S3 method for class 'Spectra'
dim(x)

Arguments

x

For nrow, length, dim, a Spectra object. For ncol, a SpectraDataFrame object.

Details

* Methods for Spectra objects

nrow returns the number of individuals in the collection length returns the number of wavelengths in the collection ncol returns NULL dim returns a vector containing (1) the number of individuals and (2) in the number of wavelengths in the collection

* Methods for Spectra objects

nrow returns the number of individuals in the collection length returns the number of wavelengths in the collection ncol returns the number of attributes in the collection dim returns a vector containing (1) the number of individuals, (2) in the number of wavelengths, and (3) the number of attributes in the collection

Value

nrow, ncol, nwl, and length, return an integer, dim returns a vector of length 2 or 3 (see Details section).

Author(s)

Pierre Roudier pierre.roudier@gmail.com

Examples

# Loading example data
data(australia)
spectra(australia) <- sr_no ~ ... ~ 350:2500

nrow(australia)
ncol(australia)
length(australia)
dim(australia)

spectacles

Storing, Manipulating and Analysis Spectroscopy and Associated Data

v0.5-3
GPL-3
Authors
Pierre Roudier [aut, cre], Max Kuhn [ctb], Kristian Hovde Liland [ctb], Bjorn-Helge Mevik [ctb], Hadley Wickham [ctb], Raphael Viscarra Rossel [dtc]
Initial release
2021-01-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.