Package: mdatools 0.14.2

mdatools: Multivariate Data Analysis for Chemometrics

Projection based methods for preprocessing, exploring and analysis of multivariate data used in chemometrics. S. Kucheryavskiy (2020) <doi:10.1016/j.chemolab.2020.103937>.

Authors:Sergey Kucheryavskiy [aut, cre]

mdatools_0.14.2.tar.gz
mdatools_0.14.2.zip(r-4.5)mdatools_0.14.2.zip(r-4.4)mdatools_0.14.2.zip(r-4.3)
mdatools_0.14.2.tgz(r-4.4-any)mdatools_0.14.2.tgz(r-4.3-any)
mdatools_0.14.2.tar.gz(r-4.5-noble)mdatools_0.14.2.tar.gz(r-4.4-noble)
mdatools_0.14.2.tgz(r-4.4-emscripten)mdatools_0.14.2.tgz(r-4.3-emscripten)
mdatools.pdf |mdatools.html
mdatools/json (API)
NEWS

# Install 'mdatools' in R:
install.packages('mdatools', repos = c('https://svkucheryavski.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/svkucheryavski/mdatools/issues

Datasets:
  • carbs - Raman spectra of carbonhydrates
  • pellets - Image data
  • people - People data
  • simdata - Spectral data of polyaromatic hydrocarbons mixing

On CRAN:

7.32 score 33 stars 1 packages 206 scripts 1.0k downloads 11 mentions 172 exports 2 dependencies

Last updated 4 months agofrom:a178dc0732. Checks:OK: 1 NOTE: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 18 2024
R-4.5-winNOTENov 18 2024
R-4.5-linuxNOTENov 18 2024
R-4.4-winNOTENov 18 2024
R-4.4-macNOTENov 18 2024
R-4.3-winNOTENov 18 2024
R-4.3-macNOTENov 18 2024

Exports:capitalizecategorizechisq.critchisq.probclassmodel.processRefValuesclassresconstraintconstraintAngleconstraintClosureconstraintNonNegativityconstraintNormconstraints.listconstraintUnimodcrossvalcrossval.regmodeldd.critddmoments.paramddrobust.paramellipseemploy.constraintemploy.prepfprintfgetCalibrationDatagetConfusionMatrixgetImplementedConstraintsgetImplementedPrepMethodsgetProbabilitiesgetPureVariablesgetRegcoeffsgetResgetSelectivityRatiogetVariance.mcrgetVIPScoreshotelling.crithotelling.probimshowiplsjm.critjm.probldecompldecomp.getLimitsCoordinatesldecomp.getLimParamsldecomp.getQLimitsldecomp.getT2Limitsldecomp.plotResidualsmcrmcralsmcrals.calmcrals.fcnnlsmcrals.nnlsmcrals.olsmcrpuremda.cbindmda.data2immda.df2matmda.exclcolsmda.exclrowsmda.getattrmda.getexclindmda.im2datamda.inclcolsmda.inclrowsmda.purgemda.purgeColsmda.purgeRowsmda.rbindmda.setattrmda.setimbgmda.showmda.subsetmda.tmdaplotmdaplot.getColorsmdaplot.getXTickLabelsmdaplot.getXTicksmdaplot.getYTickLabelsmdaplot.getYTicksmdaplotgmdaplotyypcapca.mvreplacepca.runpcarespinvplotBarsplotBiplotplotConfidenceEllipseplotContributionsplotConvexHullplotCoomanplotCorrplotCumVarianceplotDiscriminationPowerplotDistDoFplotErrorbarsplotExtremeplotHistplotHotellingEllipseplotLinesplotLoadingsplotMisclassifiedplotModelDistanceplotModellingPowerplotPerformanceplotPointsShapeplotPredictionsplotProbabilitiesplotPurityplotPuritySpectraplotQDoFplotRegcoeffsplotResidualsplotRMSEplotRMSERatioplotScatterplotScoresplotSelectionplotSelectivityRatioplotSensitivityplotseriesplotSpecificityplotSpectraplotT2DoFplotVarianceplotVIPScoresplotWeightsplotXCumVarianceplotXLoadingsplotXResidualsplotXScoresplotXVarianceplotXYLoadingsplotXYResidualsplotXYScoresplotYCumVarianceplotYResidualsplotYVarianceplspls.getLimitsCoordinatespls.getZLimitspls.runplsdaplsdaresplsresprepprep.alsbasecorrprep.autoscaleprep.listprep.mscprep.normprep.ref2kmprep.savgolprep.snvprep.transformprep.varselprepCalDatarandtestregcoeffsregcoeffs.getStatsregresregres.r2repmatselectCompNumselratiosetDistanceLimitsshowDistanceLimitsshowPredictionssimcasimcamsimcamressimcaresvipscores

Dependencies:latticeMatrix

Readme and manuals

Help Manual

Help pageTopics
as.matrix method for classification resultsas.matrix.classres
as.matrix method for ldecomp objectas.matrix.ldecomp
as.matrix method for PLS-DA resultsas.matrix.plsdares
as.matrix method for PLS resultsas.matrix.plsres
as.matrix method for regression coefficients classas.matrix.regcoeffs
as.matrix method for regression resultsas.matrix.regres
as.matrix method for SIMCAM resultsas.matrix.simcamres
as.matrix method for SIMCA classification resultsas.matrix.simcares
Capitalize text or vector with text valuescapitalize
Raman spectra of carbonhydratescarbs
Categorize PCA resultscategorize
Categorize PCA results based on orthogonal and score distances.categorize.pca
Categorize data rows based on PLS results and critical limits for total distance.categorize.pls
Calculates critical limits for distance values using Chi-square distributionchisq.crit
Calculate probabilities for distance values using Chi-square distributionchisq.prob
PLS-DA classificationclassify.plsda
SIMCA classificationclassify.simca
Check reference class values and convert it to a factor if necessaryclassmodel.processRefValues
Results of classificationclassres
Calculation of classification performance parametersclassres.getPerformance
Confidence intervals for regression coefficientsconfint.regcoeffs
Class for MCR-ALS constraintconstraint
Method for angle constraintconstraintAngle
Method for closure constraintconstraintClosure
Method for non-negativity constraintconstraintNonNegativity
Method for normalization constraintconstraintNorm
Shows information about all implemented constraintsconstraints.list
Method for unimodality constraintconstraintUnimod
Generate sequence of indices for cross-validationcrossval
Define parameters based on 'cv' valuecrossval.getParams
Cross-validation of a regression modelcrossval.regmodel
Cross-validation of a SIMCA modelcrossval.simca
String with description of cross-validation methodcrossval.str
Calculates critical limits for distance values using Data Driven moments approachdd.crit
Calculates critical limits for distance values using Data Driven moments approachddmoments.param
Calculates critical limits for distance values using Data Driven robust approachddrobust.param
Create ellipse on the current plotellipse
Applies constraint to a datasetemploy.constraint
Applies a list with preprocessing methods to a datasetemploy.prep
Imitation of fprinf() functionfprintf
Calibration datagetCalibrationData
Returns matrix with original calibration datagetCalibrationData.pca
Get calibration datagetCalibrationData.simcam
Compute confidence ellipse for a set of pointsgetConfidenceEllipse
Confusion matrix for classification resultsgetConfusionMatrix
Confusion matrix for classification resultsgetConfusionMatrix.classres
Compute coordinates of a closed convex hull for data pointsgetConvexHull
Create a vector with labels for plot seriesgetDataLabels
Shows a list with implemented constraintsgetImplementedConstraints
Shows a list with implemented preprocessing methodsgetImplementedPrepMethods
Create labels as column or row indicesgetLabelsAsIndices
Create labels from data valuesgetLabelsAsValues
Get main titlegetMainTitle
Define colors for plot seriesgetPlotColors
Get class belonging probabilitygetProbabilities
Probabilities for residual distancesgetProbabilities.pca
Probabilities of class belonging for PCA/SIMCA resultsgetProbabilities.simca
Identifies pure variablesgetPureVariables
Get regression coefficientsgetRegcoeffs
Regression coefficients for PLS model'getRegcoeffs.regmodel
Return list with valid resultsgetRes
Get selected componentsgetSelectedComponents
Selectivity ratiogetSelectivityRatio
Selectivity ratio for PLS modelgetSelectivityRatio.pls
Compute explained variance for MCR casegetVariance.mcr
VIP scoresgetVIPScores
VIP scores for PLS modelgetVIPScores.pls
Calculate critical limits for distance values using Hotelling T2 distributionhotelling.crit
Calculate probabilities for distance values and given parameters using Hotelling T2 distributionhotelling.prob
show image data as an imageimshow
Variable selection with interval PLSipls
Runs the backward iPLS algorithmipls.backward
Runs the forward iPLS algorithmipls.forward
Calculate critical limits for distance values using Jackson-Mudholkar approachjm.crit
Calculate probabilities for distance values and given parameters using Hotelling T2 distributionjm.prob
Class for storing and visualising linear decomposition of dataset (X = TP' + E)ldecomp
Compute score and residual distancesldecomp.getDistances
Compute coordinates of lines or curves with critical limitsldecomp.getLimitsCoordinates
Compute parameters for critical limits based on calibration resultsldecomp.getLimParams
Compute critical limits for orthogonal distances (Q)ldecomp.getQLimits
Compute critical limits for score distances (T2)ldecomp.getT2Limits
Compute explained varianceldecomp.getVariances
Residuals distance plot for a set of ldecomp objectsldecomp.plotResiduals
General class for Multivariate Curve Resolution modelmcr
Multivariate curve resolution using Alternating Least Squaresmcrals
Identifies pure variablesmcrals.cal
Fast combinatorial non-negative least squaresmcrals.fcnnls
Non-negative least squaresmcrals.nnls
Ordinary least squaresmcrals.ols
Multivariate curve resolution based on pure variablesmcrpure
A wrapper for cbind() method with proper set of attributesmda.cbind
Convert data matrix to an imagemda.data2im
Convert data frame to a matrixmda.df2mat
Exclude/hide columns in a datasetmda.exclcols
Exclude/hide rows in a datasetmda.exclrows
Get data attributesmda.getattr
Get indices of excluded rows or columnsmda.getexclind
Convert image to data matrixmda.im2data
Include/unhide the excluded columnsmda.inclcols
include/unhide the excluded rowsmda.inclrows
Removes excluded (hidden) rows and colmns from datamda.purge
Removes excluded (hidden) colmns from datamda.purgeCols
Removes excluded (hidden) rows from datamda.purgeRows
A wrapper for rbind() method with proper set of attributesmda.rbind
Set data attributesmda.setattr
Remove background pixels from image datamda.setimbg
Wrapper for show() methodmda.show
A wrapper for subset() method with proper set of attributedmda.subset
A wrapper for t() method with proper set of attributesmda.t
Plotting function for a single set of objectsmdaplot
Check color valuesmdaplot.areColors
Format vector with numeric valuesmdaplot.formatValues
Color values for plot elementsmdaplot.getColors
Calculate limits for x-axis.mdaplot.getXAxisLim
Prepare xticklabels for plotmdaplot.getXTickLabels
Prepare xticks for plotmdaplot.getXTicks
Calculate limits for y-axis.mdaplot.getYAxisLim
Prepare yticklabels for plotmdaplot.getYTickLabels
Prepare yticks for plotmdaplot.getYTicks
Create axes planemdaplot.plotAxes
Prepare colors based on palette and opacity valuemdaplot.prepareColors
Plot colorbarmdaplot.showColorbar
Plot linesmdaplot.showLines
Plotting function for several plot seriesmdaplotg
Create and return vector with legend valuesmdaplotg.getLegend
Compute x-axis limits for mdaplotgmdaplotg.getXLim
Compute y-axis limits for mdaplotgmdaplotg.getYLim
Prepare data for mdaplotgmdaplotg.prepareData
Check mdaplotg parameters and replicate them if necessarymdaplotg.processParam
Show legend for mdaplotgmdaplotg.showLegend
Create line plot with double y-axismdaplotyy
Package for Multivariate Data Analysis (Chemometrics)mdatools
Principal Component Analysispca
PCA model calibrationpca.cal
Low-dimensional approximation of data matrix Xpca.getB
Replace missing values in datapca.mvreplace
NIPALS based PCA algorithmpca.nipals
Runs one of the selected PCA methodspca.run
Singular Values Decomposition based PCA algorithmpca.svd
Results of PCA decompositionpcares
Image datapellets
People datapeople
Pseudo-inverse matrixpinv
Plot function for classification resultsplot.classres
Overview plot for iPLS resultsplot.ipls
Plot summary for MCR modelplot.mcr
Model overview plot for PCAplot.pca
Plot method for PCA results objectplot.pcares
Model overview plot for PLSplot.pls
Model overview plot for PLS-DAplot.plsda
Overview plot for PLS-DA resultsplot.plsdares
Overview plot for PLS resultsplot.plsres
Plot for randomization test resultsplot.randtest
Regression coefficients plotplot.regcoeffs
Plot method for regression resultsplot.regres
Model overview plot for SIMCAplot.simca
Model overview plot for SIMCAMplot.simcam
Model overview plot for SIMCAM resultsplot.simcamres
Show plot series as barsplotBars
BiplotplotBiplot
PCA biplotplotBiplot.pca
Add confidence ellipse for groups of points on scatter plotplotConfidenceEllipse
Plot resolved contributionsplotContributions
Show plot with resolved contributionsplotContributions.mcr
Add convex hull for groups of points on scatter plotplotConvexHull
Cooman's plotplotCooman
Cooman's plot for SIMCAM modelplotCooman.simcam
Cooman's plot for SIMCAM resultsplotCooman.simcamres
Correlation plotplotCorr
Correlation plot for randomization test resultsplotCorr.randtest
Variance plotplotCumVariance
Cumulative explained variance plotplotCumVariance.ldecomp
Show plot with cumulative explained varianceplotCumVariance.mcr
Cumulative explained variance plot for PCA modelplotCumVariance.pca
Show plot series as density plot (using hex binning)plotDensity
Discrimination power plotplotDiscriminationPower
Discrimination power plot for SIMCAM modelplotDiscriminationPower.simcam
Degrees of freedom plot for both distancesplotDistDoF
Show plot series as error barsplotErrorbars
Shows extreme plot for SIMCA modelplotExtreme
Extreme plotplotExtreme.pca
Statistic histogramplotHist
Histogram plot for randomization test resultsplotHist.randtest
Hotelling ellipseplotHotellingEllipse
Show plot series as set of linesplotLines
Loadings plotplotLoadings
Loadings plot for PCA modelplotLoadings.pca
Misclassification ratio plotplotMisclassified
Misclassified ratio plot for classification modelplotMisclassified.classmodel
Misclassified ratio plot for classification resultsplotMisclassified.classres
Model distance plotplotModelDistance
Model distance plot for SIMCAM modelplotModelDistance.simcam
Modelling power plotplotModellingPower
Classification performance plotplotPerformance
Performance plot for classification modelplotPerformance.classmodel
Performance plot for classification resultsplotPerformance.classres
Add confidence ellipse or convex hull for group of pointsplotPointsShape
Predictions plotplotPredictions
Predictions plot for classification modelplotPredictions.classmodel
Prediction plot for classification resultsplotPredictions.classres
Predictions plot for regression modelplotPredictions.regmodel
Predictions plot for regression resultsplotPredictions.regres
Predictions plot for SIMCAM modelplotPredictions.simcam
Prediction plot for SIMCAM resultsplotPredictions.simcamres
Plot for class belonging probabilityplotProbabilities
Plot for class belonging probabilityplotProbabilities.classres
Plot purity valuesplotPurity
Purity values plotplotPurity.mcrpure
Plot purity spectraplotPuritySpectra
Purity spectra plotplotPuritySpectra.mcrpure
Degrees of freedom plot for orthogonal distance (Nh)plotQDoF
Regression coefficients plotplotRegcoeffs
Regression coefficient plot for regression modelplotRegcoeffs.regmodel
Add regression line for data pointsplotRegressionLine
Residuals plotplotResiduals
Residual distance plotplotResiduals.ldecomp
Residuals distance plot for PCA modelplotResiduals.pca
Residuals plot for regression resultsplotResiduals.regres
RMSE plotplotRMSE
RMSE development plotplotRMSE.ipls
RMSE plot for regression modelplotRMSE.regmodel
RMSE plot for regression resultsplotRMSE.regres
Plot for ratio RMSEC/RMSECV vs RMSECVplotRMSERatio
RMSECV/RMSEC ratio plot for regression modelplotRMSERatio.regmodel
Show plot series as set of pointsplotScatter
Scores plotplotScores
Scores plotplotScores.ldecomp
Scores plot for PCA modelplotScores.pca
Selected intervals plotplotSelection
iPLS performance plotplotSelection.ipls
Selectivity ratio plotplotSelectivityRatio
Selectivity ratio plot for PLS modelplotSelectivityRatio.pls
Sensitivity plotplotSensitivity
Sensitivity plot for classification modelplotSensitivity.classmodel
Sensitivity plot for classification resultsplotSensitivity.classres
Create plot series object based on data, plot type and parametersplotseries
Specificity plotplotSpecificity
Specificity plot for classification modelplotSpecificity.classmodel
Specificity plot for classification resultsplotSpecificity.classres
Plot resolved spectraplotSpectra
Show plot with resolved spectraplotSpectra.mcr
Degrees of freedom plot for score distance (Nh)plotT2DoF
Variance plotplotVariance
Explained variance plotplotVariance.ldecomp
Show plot with explained varianceplotVariance.mcr
Explained variance plot for PCA modelplotVariance.pca
Variance plot for PLSplotVariance.pls
Explained X variance plot for PLS resultsplotVariance.plsres
VIP scores plotplotVIPScores
VIP scores plot for PLS modelplotVIPScores.pls
Plot for PLS weightsplotWeights
X loadings plot for PLSplotWeights.pls
X cumulative variance plotplotXCumVariance
Cumulative explained X variance plot for PLSplotXCumVariance.pls
Explained cumulative X variance plot for PLS resultsplotXCumVariance.plsres
X loadings plotplotXLoadings
X loadings plot for PLSplotXLoadings.pls
X residuals plotplotXResiduals
Residual distance plot for decomposition of X dataplotXResiduals.pls
X residuals plot for PLS resultsplotXResiduals.plsres
X scores plotplotXScores
X scores plot for PLSplotXScores.pls
X scores plot for PLS resultsplotXScores.plsres
X variance plotplotXVariance
Explained X variance plot for PLSplotXVariance.pls
Explained X variance plot for PLS resultsplotXVariance.plsres
X loadings plotplotXYLoadings
XY loadings plot for PLSplotXYLoadings.pls
Plot for XY-residualsplotXYResiduals
Residual XY-distance plotplotXYResiduals.pls
Residual distance plotplotXYResiduals.plsres
XY scores plotplotXYScores
XY scores plot for PLSplotXYScores.pls
XY scores plot for PLS resultsplotXYScores.plsres
Y cumulative variance plotplotYCumVariance
Cumulative explained Y variance plot for PLSplotYCumVariance.pls
Explained cumulative Y variance plot for PLS resultsplotYCumVariance.plsres
Y residuals plotplotYResiduals
Y residuals plot for PLS resultsplotYResiduals.plsres
Y residuals plot for regression modelplotYResiduals.regmodel
Y variance plotplotYVariance
Explained Y variance plot for PLSplotYVariance.pls
Explained Y variance plot for PLS resultsplotYVariance.plsres
Partial Least Squares regressionpls
PLS model calibrationpls.cal
Compute coordinates of lines or curves with critical limitspls.getLimitsCoordinates
Compute predictions for response valuespls.getpredictions
Compute object with decomposition of x-valuespls.getxdecomp
Compute matrix with X-scorespls.getxscores
Compute object with decomposition of y-valuespls.getydecomp
Compute and orthogonalize matrix with Y-scorespls.getyscores
Compute critical limits for orthogonal distances (Q)pls.getZLimits
Runs selected PLS algorithmpls.run
SIMPLS algorithmpls.simpls
SIMPLS algorithm (old implementation)pls.simplsold
Partial Least Squares Discriminant Analysisplsda
PLS-DA resultsplsdares
PLS resultsplsres
MCR ALS predictionspredict.mcrals
MCR predictionspredict.mcrpure
PCA predictionspredict.pca
PLS predictionspredict.pls
PLS-DA predictionspredict.plsda
SIMCA predictionspredict.simca
SIMCA multiple classes predictionspredict.simcam
Class for preprocessing objectprep
Baseline correction using asymetric least squaresprep.alsbasecorr
Autoscale valuesprep.autoscale
Generic function for preprocessingprep.generic
Shows information about all implemented preprocessing methods.prep.list
Multiplicative Scatter Correction transformationprep.msc
Normalizationprep.norm
Kubelka-Munk transformationprep.ref2km
Savytzky-Golay filterprep.savgol
Standard Normal Variate transformationprep.snv
Transformationprep.transform
Variable selectionprep.varsel
Take dataset and prepare them for plotpreparePlotData
Prepares calibration dataprepCalData
Print information about classification result objectprint.classres
Print method for iPLSprint.ipls
Print method for linear decompositionprint.ldecomp
Print method for mcrpure objectprint.mcrals
Print method for mcrpure objectprint.mcrpure
Print method for PCA model objectprint.pca
Print method for PCA results objectprint.pcares
Print method for PLS model objectprint.pls
Print method for PLS-DA model objectprint.plsda
Print method for PLS-DA results objectprint.plsdares
print method for PLS results objectprint.plsres
Print method for randtest objectprint.randtest
print method for regression coefficients classprint.regcoeffs
Print method for PLS model objectprint.regmodel
print method for regression results objectprint.regres
Print method for SIMCA model objectprint.simca
Print method for SIMCAM model objectprint.simcam
Print method for SIMCAM results objectprint.simcamres
Print method for SIMCA results objectprint.simcares
Randomization test for PLS regressionrandtest
Regression coefficientsregcoeffs
Distribution statistics for regression coeffificentsregcoeffs.getStats
Regression resultsregres
Prediction biasregres.bias
Error of predictionregres.err
Determination coefficientregres.r2
RMSEregres.rmse
Sloperegres.slope
Add names and attributes to matrix with statisticsregress.addattrs
Replicate matric xrepmat
Select optimal number of components for a modelselectCompNum
Select optimal number of components for PCA modelselectCompNum.pca
Select optimal number of components for PLS modelselectCompNum.pls
Selectivity ratio calculationselratio
Set residual distance limitssetDistanceLimits
Compute and set statistical limits for Q and T2 residual distances.setDistanceLimits.pca
Compute and set statistical limits for residual distances.setDistanceLimits.pls
Show residual distance limitsshowDistanceLimits
Show labels on plotshowLabels
PredictionsshowPredictions
Show predicted class valuesshowPredictions.classres
SIMCA one-class classificationsimca
SIMCA multiclass classificationsimcam
Performance statistics for SIMCAM modelsimcam.getPerformanceStats
Results of SIMCA multiclass classificationsimcamres
Results of SIMCA one-class classificationsimcares
Spectral data of polyaromatic hydrocarbons mixingsimdata
Split the excluded part of datasplitExcludedData
Split dataset to x and y values depending on plot typesplitPlotData
Summary statistics about classification result objectsummary.classres
Summary for iPLS resultssummary.ipls
Summary statistics for linear decompositionsummary.ldecomp
Summary method for mcrals objectsummary.mcrals
Summary method for mcrpure objectsummary.mcrpure
Summary method for PCA model objectsummary.pca
Summary method for PCA results objectsummary.pcares
Summary method for PLS model objectsummary.pls
Summary method for PLS-DA model objectsummary.plsda
Summary method for PLS-DA results objectsummary.plsdares
summary method for PLS results objectsummary.plsres
Summary method for randtest objectsummary.randtest
Summary method for regcoeffs objectsummary.regcoeffs
Summary method for regression model objectsummary.regmodel
summary method for regression results objectsummary.regres
Summary method for SIMCA model objectsummary.simca
Summary method for SIMCAM model objectsummary.simcam
Summary method for SIMCAM results objectsummary.simcamres
Summary method for SIMCA results objectsummary.simcares
Unmix spectral data using pure variables estimated beforeunmix.mcrpure
VIP scores for PLS modelvipscores