Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
svkucheryavski committed Jan 3, 2019
2 parents 1a44ae6 + a129cef commit 3aaae88
Show file tree
Hide file tree
Showing 53 changed files with 163 additions and 112 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Package: mdatools
Title: Multivariate Data Analysis for Chemometrics
Version: 0.9.2
Date: 2018-11-09
Version: 0.9.3
Date: 2019-01-03
Author: Sergey Kucheryavskiy
Maintainer: Sergey Kucheryavskiy <[email protected]>
Description: Package implements projection based methods for preprocessing,
exploring and analysis of multivariate data used in chemometrics.
Encoding: UTF-8
License: MIT + file LICENSE
Imports:
methods,
graphics,
grDevices,
stats
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
Suggests: testthat
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ S3method(summary,simca)
S3method(summary,simcam)
S3method(summary,simcamres)
S3method(summary,simcares)
export(classres)
export(crossval)
export(erfinv)
export(getCalibrationData)
export(getConfusionMatrix)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v.0.9.3
=======
* fixed a bug leading to wrong results in multiclass PLS-DA if class labels in reference class variable (factor) were not in alphabetical order

v.0.9.2
=======
* improvements to `ipls()` method plus fixed a bug preventing breaking the selection loop (#56)
Expand Down
2 changes: 1 addition & 1 deletion R/classres.R
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ getConfusionMatrix.classres = function(obj, ncomp = NULL, ...) {
# get class names and numbers
classes = dimnames(obj$c.pred)[[3]]
nclasses = length(classes)
ref.classes = unique(obj$c.ref)
ref.classes = levels(as.factor(obj$c.ref))
ref.nclasses = length(ref.classes)

# compute the confusion matrix
Expand Down
4 changes: 3 additions & 1 deletion R/pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,14 @@ getCalibrationData.pca = function(obj, ...) {
#' PCA model (object of class \code{pca})
#' @param ncomp
#' number of components to select
#' @param ...
#' other parameters if any
#'
#' @return
#' the same model with selected number of components
#'
#' @export
selectCompNum.pca = function(model, ncomp) {
selectCompNum.pca = function(model, ncomp, ...) {
if (ncomp < 1 || ncomp > model$ncomp)
stop('Wrong number of selected components!')

Expand Down
4 changes: 3 additions & 1 deletion R/pls.R
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,8 @@ pls.crossval = function(model, x, y, cv, center, scale, method, jack.knife = T)
#' @param selcrit
#' criterion for selecting optimal number of components (\code{'min'} for
#' first local minimum of RMSECV and \code{'wold'} for Wold's rule.)
#' @param ...
#' other parameters if any
#'
#' @return
#' the same model with selected number of components
Expand All @@ -813,7 +815,7 @@ pls.crossval = function(model, x, y, cv, center, scale, method, jack.knife = T)
#' See examples in help for \code{\link{pls}} function.
#'
#' @export
selectCompNum.pls = function(model, ncomp = NULL, selcrit = model$ncomp.selcrit) {
selectCompNum.pls = function(model, ncomp = NULL, selcrit = model$ncomp.selcrit, ...) {
if (!is.null(ncomp)) {
# user defined number of components
if (ncomp > model$ncomp || ncomp < 0)
Expand Down
3 changes: 2 additions & 1 deletion R/plsda.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,9 @@ plsda.cal = function(x, c, ncomp, center, scale, cv, method, light, alpha, coeff
} else {
c = checkReferenceValues.classmodel(m, c, x)
y = mda.df2mat(as.factor(c), full = TRUE)
classnames = unique(c)
classnames = levels(as.factor(c))
}

y[y == 0] = -1
colnames(y) = classnames
rownames(y) = rownames(x)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For more details and examples read a [Bookdown tutorial](http://svkucheryavski.g
What is new
-----------

New minor release (0.9.2) is available both from GitHub and CRAN (from 9.11.2018).
New minor release (0.9.3) is available both from GitHub and CRAN (from 3.01.2019).

The latest major release (0.9.0) brings a set of new features, including methods for computing of critical limits for PCA/SIMCA residuals, adjuested residuals plot, and randomized algorithms for fast PCA decomposition of dataset with large number of rows. The text of tutorial has been amended correspondingly and now also includes a new chapter with detailed explanation of calculation of the critical limits.

Expand All @@ -20,10 +20,10 @@ A full list of changes is available [here](NEWS.md)
How to install
--------------

The package is available from CRAN by usual installing procedure. However due to restrictions in CRAN politics regarding number of submissions (one in 3-4 month) only major releases will be published there (with 2-3 weeks delay after GitHub release as more thorought testing is needed). To get the latest release plase use [GitHub sources](https://github.com/svkucheryavski/mdatools). You can [download](https://github.com/svkucheryavski/mdatools/releases) a zip-file with source package and install it using the `install.packages` command, e.g. if the downloaded file is `mdatools_0.9.2.tar.gz` and it is located in a current working directory, just run the following:
The package is available from CRAN by usual installing procedure. However due to restrictions in CRAN politics regarding number of submissions (one in 3-4 month) only major releases will be published there (with 2-3 weeks delay after GitHub release as more thorought testing is needed). To get the latest release plase use [GitHub sources](https://github.com/svkucheryavski/mdatools). You can [download](https://github.com/svkucheryavski/mdatools/releases) a zip-file with source package and install it using the `install.packages` command, e.g. if the downloaded file is `mdatools_0.9.3.tar.gz` and it is located in a current working directory, just run the following:

```
install.packages('mdatools_0.9.2.tar.gz')
install.packages('mdatools_0.9.3.tar.gz')
```

If you have `devtools` package installed, the following command will install the latest release from the master branch of GitHub repository (do not forget to load the `devtools` package first):
Expand Down
7 changes: 4 additions & 3 deletions man/getRegcoeffs.pls.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/ipls.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/ldecomp.getDistances.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/mdaplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/mdaplot.getAxesLim.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/mdaplot.plotAxes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/mdaplot.showLines.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/mdaplot.showRegressionLine.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions man/mdaplotg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/pca.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/pca.cal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/pca.mvreplace.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/plot.randtest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/plot.regcoeffs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/plotCooman.simcamres.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/plotCumVariance.ldecomp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/plotModelDistance.simcam.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/plotPerformance.classmodel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/plotPredictions.plsres.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/plotPredictions.regres.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions man/plotRMSE.ipls.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3aaae88

Please sign in to comment.