Description Usage Arguments Details Note Note Author(s) References See Also Examples
Reads binary OPUS files containing infrared, near infrared and Raman spectroscopy measurements (absorbances) and generates an object of class "SpectraPoints"
.
1 2 3 4 5 6 7 8 |
## S4 method for signature 'character'
read.opus(file.name, sp = NULL,
codes = c("ZFF","RES","SNM","DAT","LWN","FXV","LXV","NPT","MXY","MNY","END","TIM"),
plot.spectra = FALSE, print.progress = FALSE, speclib = "ICRAF",
signif.digit = get("signif.digit", spec.opts), MID, st.wavenumbers = wavenumbers)
## S4 method for signature 'list'
read.opus(file.name, ...)
|
file.name |
|
sp |
|
codes |
|
plot.spectra |
|
print.progress |
|
signif.digit |
|
speclib |
|
MID |
|
st.wavenumbers |
|
... |
other optional arguments |
This function will read OPUS files from Bruker Optics' Alpha, MPA and Tensor-27 spectrometers. A choice for the type of spectral library to be created from the data tables created is done. To match data points to ICRAF's spectral library set speclib = "ICRAF"
, otherwise to create own spectral library based on OPUS files being converted set speclib="New"
.
Setting speclib = "New"
may produce spectra with non-overlapping points brought about by slight drifts on the equipement and combinining with different columns can cause problems. If one chooses to create their own library, stable data points observed over time should be used to align all future scans.
Reading long list of binary files can be time and memory consuming.
Andrew Sila and Tomislav Hengl
SpectraPoints-class
, predict.SpectraPoints
, wavenumbers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Original binary Opus files:
pth = system.file(package = "soil.spec")
lst <- as.list(list.files(path=pth, pattern="*.0$", full.names=TRUE))
file.info(lst[[1]])
xx <- read.opus(lst)
str(xx)
## predict pH
data(m.PHIHOX)
s.xx <- predict(xx, model = m.PHIHOX, prob. = .75)
s.xx
## Note: duplicate samples get unique name by default
## predict all standard soil properties:
nm <- get("attributes", spec.opts)
nm
pr.lst <- NULL
for(k in 1:length(nm)){
data(list=paste("m.", nm[k], sep=""))
try( pr.lst[[k]] <- predict(xx, variable=nm[k],
model = get(paste("m.", nm[k], sep="")), prob. = .75) )
}
pr <- do.call(cbind, pr.lst)
str(pr)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.