View source: R/gen_coreDataManip.r
do_msc | R Documentation |
Performs MSC (multiplicative scatter correction) on the provided dataset.
do_msc(dataset, ref = NULL, extMscModel = NULL, exportModel = FALSE)
dataset |
An object of class 'aquap_data" as produced by
|
ref |
An object of class 'aquap_data' containing a single spectrum,
i.e. a single row (as e.g. produced by |
extMscModel |
Provide an external msc model to use this for predicting the data instead of running msc on the data. Experimental feature. |
exportModel |
Logical. If a possible model should be stored in the set,
(leave at |
If no reference is provided, the average of all spectra of the provided
dataset is used as a reference for the baseline correction. Provide a dataset
with a single spectrum (as e.g. produced by do_avg
) to use this
as a reference for baseline correction. Internally, the function
msc
is used.
Returns the dataset with the transformed NIR data.
ssc
for sub-selecting in a datset using a specific
criterion.
getcd
Other Data pre-treatment functions:
[,aquap_data-method
,
do_addNoise()
,
do_avg()
,
do_blowup()
,
do_detrend()
,
do_emsc()
,
do_gapDer()
,
do_resampleNIR()
,
do_sgolay()
,
dpt_modules
,
selectWls()
,
ssc()
Other dpt modules documentation:
do_detrend()
,
do_emsc()
,
do_gapDer()
,
do_sgolay()
,
do_snv()
,
dpt_modules
## Not run:
fd <- gfd() # get the full dataset
fd <- selectWls(fd, 1100, 1800)
fd_msc <- do_msc(fd)
plot(fd - fd_msc, pg.where="", pg.main="| msc subtracted")
fd_msc_ref <- do_msc(fd, ref=fd[4]) # use the 4th row of fd as a reference
plot(fd - fd_msc_ref, pg.where="", pg.main="| 4th row as reference")
fd_msc_mq <- do_msc(fd, ref=do_avg(ssc(fd, C_Group=="MQ"))) # is assuming the
# existence of a column name "C_Group" and one or more of its values being "MQ"
plot(fd - fd_msc_mq, pg.where="", pg.main="| average of MQ as reference")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.