Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
svkucheryavski committed Mar 28, 2023
2 parents 35b4cdb + b8ab96d commit 20e954d
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 344 deletions.
14 changes: 7 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Package: mdatools
Version: 0.14.0
Title: Multivariate Data Analysis for Chemometrics
Version: 0.13.1
Date: 2022-11-09
Author: Sergey Kucheryavskiy (<https://orcid.org/0000-0002-3145-7244>)
Date: 2023-03-28
Authors@R: c(person("Sergey", "Kucheryavskiy", role = c("aut", "cre"), email="[email protected]", comment = c(ORCID = "0000-0002-3145-7244")))
Maintainer: Sergey Kucheryavskiy <[email protected]>
Description: Projection based methods for preprocessing,
exploring and analysis of multivariate data used in chemometrics.
S. Kucheryavskiy (2020) <doi: 10.1016/j.chemolab.2020.103937>.
Description: Projection based methods for preprocessing, exploring and analysis of multivariate data used in chemometrics. S. Kucheryavskiy (2020) <doi:10.1016/j.chemolab.2020.103937>.
Encoding: UTF-8
License: MIT + file LICENSE
Imports: methods, graphics, grDevices, stats, Matrix
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Suggests: testthat
NeedsCompilation: no
Packaged: 2019-05-24 11:03:33 UTC; svkucheryavski
Depends: R (>= 3.5.0)
URL: https://github.com/svkucheryavski/mdatools
BugReports: https://github.com/svkucheryavski/mdatools/issues
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ export(ddrobust.param)
export(ellipse)
export(employ.constraint)
export(employ.prep)
export(eye)
export(fprintf)
export(getCalibrationData)
export(getConfusionMatrix)
Expand Down Expand Up @@ -236,7 +235,6 @@ export(pca)
export(pca.mvreplace)
export(pca.run)
export(pcares)
export(pcv)
export(pinv)
export(plotBars)
export(plotBiplot)
Expand Down
16 changes: 16 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
v. 0.14.0
==========

The changes are relatively small, but some of them can be potentially breaking, hence the version is bumped up to 0.14.0.

* Procrustes cross-validation method, `pcv()`, has been recently improved and extended. It was decided to move it to a separate dedicated R package, `pcv`. Check [GitHub repo](https://github.com/svkucheryavski/pcv) for details. The documentation chapter has been updated accordingly.

* Fixed a bug related to generating segment indices for Venetian blinds cross-validation for regression. In case of regression, the indices are generating by taking into account the order of the response values. There was a small bug in this implementation, now it is fixed. Remember, that you can always provide manually generated vector og segment indices as value of `cv` argument.

* Made small changes in `prep.alsbasecorr()` to meet new requirements of the `Matrix` package. So if you saw warning message from this package last couple of month, this update will fix this.

* fixed bug [#109](https://github.com/svkucheryavski/mdatools/issues/109)

* small improvements in documentation.


v. 0.13.1
==========

Expand Down
3 changes: 2 additions & 1 deletion R/crossval.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ crossval <- function(cv = 1, nobj = NULL, resp = NULL) {
}

if (p$type == "ven") {
ind <- if (is.null(resp)) seq_len(nobj) else order(resp)

ind <- if (is.null(resp)) seq_len(nobj) else order(order(resp))
return(matrix(rep(seq_len(p$nseg), length.out = nobj)[ind], ncol = 1))
}

Expand Down
176 changes: 0 additions & 176 deletions R/pcv.R

This file was deleted.

4 changes: 3 additions & 1 deletion R/prep.R
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,17 @@ prep.alsbasecorr <- function(data, plambda = 5, p = 0.1, max.niter = 10) {

m <- ncol(data)
baseline <- matrix(0, nrow(data), ncol(data))

LDD <- Matrix::Matrix((10^plambda) * crossprod(diff(diag(m), difference = 2)), sparse = TRUE)
w.ini <- matrix(rep(1, m))

for (i in seq_len(nrow(data))) {
y <- data[i, ]
w <- w.ini

for (j in seq_len(max.niter)) {
W <- Matrix::Diagonal(x = as.numeric(w))
z <- Matrix::solve(as(W + LDD, "dgCMatrix"), w * y, sparse = TRUE)
z <- Matrix::solve(as(W + LDD, "generalMatrix"), w * y, sparse = TRUE)
w.old <- w
w <- p * (y > z) + (1 - p) * (y < z)

Expand Down
2 changes: 1 addition & 1 deletion R/simcares.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ as.matrix.simcares <- function(x, ncomp = NULL, ...) {
out[, 1:2] <- round(out[, 1:2], 2)

colnames(out) <- c("Expvar", "Cumexpvar", "TP", "FP", "TN", "FN",
"Spec.", "Sens.", "Accuracy")
"Spec.", "Sens.", "Accuracy")[seq_len(ncol(out))]

return(out)
}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ If you want to cite the package, please use the following: Sergey Kucheryavskiy,
What is new
-----------

Latest release (0.13.1) is available both from GitHub and CRAN. You can see the full list of changes [here](NEWS.md). The Bookdown tutorial has been also updated and contains the description of new methods added in the last release.
Latest release (0.14.0) is available both from GitHub and CRAN. You can see the full list of changes [here](NEWS.md). The Bookdown tutorial has been also updated and contains the description of new methods added in the last release.


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), mostly major releases will be published there (with 2-3 weeks delay after GitHub release as more thorough testing is needed). 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.13.1.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), mostly major releases will be published there (with 2-3 weeks delay after GitHub release as more thorough testing is needed). 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.14.0.tar.gz` and it is located in a current working directory, just run the following:

```
install.packages("mdatools_0.13.1.tar.gz")
install.packages("mdatools_0.14.0.tar.gz")
```

If you have `devtools` package installed, the following command will install the current developer version from the master branch of GitHub repository (do not forget to load the `devtools` package first):
Expand Down
17 changes: 0 additions & 17 deletions man/eye.Rd

This file was deleted.

19 changes: 0 additions & 19 deletions man/getR.Rd

This file was deleted.

1 change: 0 additions & 1 deletion man/mdatools.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ So far the following modelling and validation methods are implemented:
\code{\link{ipls}} \tab Interval PLS variable.\cr
\code{\link{mcrals}} \tab Multivariate Curve Resolution with Alternating Least Squares.\cr
\code{\link{mcrpure}} \tab Multivariate Curve Resolution with Purity approach.\cr
\code{\link{pcv}} \tab Procrustes Cross Validation.\cr
}

Methods for data preprocessing:
Expand Down
37 changes: 0 additions & 37 deletions man/pcv.Rd

This file was deleted.

17 changes: 0 additions & 17 deletions man/rotationMatrixToX1.Rd

This file was deleted.

Loading

0 comments on commit 20e954d

Please sign in to comment.