Description Usage Arguments Details Examples
Operators acting on Spectra
objects to extract parts
Operators acting on Spectra
object and Spectra
lists to extract or replace parts.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## S4 method for signature 'Spectra'
x$name
## S4 replacement method for signature 'Spectra'
x$name <- value
## S4 method for signature 'Spectra'
x[i, j]
## S4 method for signature 'Spectra,character,missing'
x[[i, j]]
## S4 replacement method for signature 'Spectra,character,missing'
x[[i, j]] <- value
|
x |
A |
name |
A character (column name) or a numeric (column index) variable |
value |
A vector or matrix or data.frame. Values to be replaced with matched |
i |
A numeric (row index) variable |
j |
A character (column name) or a numeric (column index) variable |
These operators are generic. You can write methods to handle indexing of specific classes of objects
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | sp<-spc.example_spectra()
# spc.colnames() is used to extract column names
head(spc.colnames(sp))
head(sp$anap_300)
sp[,"anap_345"]
sp[,"anap_345"] #returns Spectra object with only one channel (column)
sp[1:3,"anap_345"] #returns Spectra object with first 3 rows and only one channel (column)
# spc.colnames() is used to extract column names
head(spc.colnames(sp))
head(sp$anap_300)
sp[,"anap_345"]
sp=spc.example_spectra()
sp #501 spectral channels in columns and 26 observations in rows
sp[1] #returns Spectra object, 501 spectral channels in columns and 1 observations in rows
names(sp)
sp[["CAST"]] #returns the CAST data column
sp[[4]] #returns the CAST data column
sp[["CAST"]]=12 #Modify the CAST column
sp[["CAST"]] #returns the CAST data column
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.