as.data.frame.spectra | R Documentation |
Returns a data.frame that includes sample names, metadata (if present) and value data. One advantage over as.matrix, is that the metadata are returned.
## S3 method for class 'spectra'
as.data.frame(
x,
row.names = NULL,
optional = FALSE,
fix_names = "none",
metadata = TRUE,
...
)
x |
spectra object |
row.names |
does nothing. Here for compatibility with S3 generics |
optional |
does nothing. Here for compatibility with S3 generics |
fix_names |
Use make.names to normalize names? Pick one: "none" "row" "col" "both". |
metadata |
boolean. Include spectral metadata? Defaults to TRUE |
... |
extra parameters passed to the generic as_spectra |
data.frame with: sample_name, metadata (if any) and value.
Jose Eduardo Meireles
library(spectrolab)
spec = as_spectra(spec_matrix_example, name_idx = 1)
df = as.data.frame(spec, fix_names = "none")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.