Learn R Programming

hyperSpec (version 0.95)

as.data.frame-methods: Conversion of a hyperSpec object into a data.frame or matrix

Description

as.data.frame returns x@data as.long.df returns a long-format data.frame

as.matrix returns the spectra matrix x@data$spc

Usage

## S3 method for class 'hyperSpec,missing,missing':
as.data.frame(x, row.names = NULL, optional = FALSE, \dots)
as.long.df (x, rownames = FALSE)
## S3 method for class 'hyperSpec':
as.matrix(x, \dots)

Arguments

x
a hyperSpec object
row.names, optional, ...
ignored
rownames
should the rownames be in column .rownames of the long-format data.frame?

Value

  • x@data and x@data$spc, respectively.

Details

Long-format data.frame: this is the stacked or molten version of x@data.

See Also

as.data.frame and as.matrix

[

stack and melt for other functions producing long-format data.frames.

Examples

Run this code
as.data.frame (chondro [1:3,, 600:620])
as.matrix (chondro [1:3,, 600:620])

Run the code above in your browser using DataLab