Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@
^CODE_OF_CONDUCT\.md$
^vignettes/.*_files$

vignettes/.quarto/
vignettes/*_cache/
vignettes/*_files/

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ vignettes/*_files/
docs
/doc/
/Meta/
Makevars.omp
Makevars.omp

vignettes/.quarto/
vignettes/*_cache/
vignettes/*_files/
12 changes: 7 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: resemble
Type: Package
Title: Similarity Retrieval and Local Learning for Spectral Chemometrics
Version: 3.0.1
Date: 2026-04-21
Date: 2026-06-18
Authors@R: c(
person(given = "Leonardo",
family = "Ramirez-Lopez",
Expand All @@ -23,9 +23,11 @@ Description:
spectral data sets, including memory-based learning (MBL), optimal subset
search and selection, and retrieval-based modelling with model libraries.
Supports local learning, optimisation of spectral libraries, and
ensemble prediction from precomputed models.
Most of these functions are based on the methods presented in
Ramirez-Lopez et al. (2013) <doi:10.1016/j.geoderma.2012.12.014>.
ensemble prediction from precomputed models. Most of these functions are
based on the methods presented in Ramirez-Lopez et al. (2013)
<doi:10.1016/j.geoderma.2012.12.014>, Ramirez-Lopez et al. (2026a)
<doi:10.1016/j.aca.2026.345682>, and Ramirez-Lopez et al. (2026b)
<doi:10.1016/j.aca.2026.345651>.
License: MIT + file LICENSE
URL: https://l-ramirez-lopez.github.io/resemble/, https://github.com/l-ramirez-lopez/resemble
Depends:
Expand All @@ -52,7 +54,7 @@ VignetteBuilder: quarto
NeedsCompilation: yes
LazyData: true
Repository: CRAN
RoxygenNote: 7.3.3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Config/VersionName: tarragona
Config/roxygen2/version: 8.0.0
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ S3method(plot,ortho_projection)
S3method(predict,gesearch)
S3method(predict,liblex)
S3method(predict,ortho_projection)
S3method(predict,plsr)
S3method(predict,resemble_model)
S3method(print,diss_correlation)
S3method(print,diss_method)
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# `resemble 3.0.1 (tarragona)`
===============

## Fixes

- Fixed: An error was thrown when passing a categorical variable as side info in `diss_evaluate()`.

- Vignettes appear now in the right order in CRAN.

# `resemble 3.0.0 (vertex)`
===============

Expand Down
7 changes: 7 additions & 0 deletions R/AAA.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
.onLoad <- function(lib, pkg) {
n <- suppressWarnings(as.integer(Sys.getenv("OMP_NUM_THREADS", unset = NA_character_)))
if (!is.na(n) && n >= 1L) {
resemble_set_omp_threads(n)
}
}

.onAttach <- function(lib, pkg) {
pkg_v <- pkg_info()

Expand Down
6 changes: 6 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -1150,3 +1150,9 @@ ith_pred_cpp <- function(plslib, xscale, Xu, dxrxu = NULL) {
.Call(`_resemble_ith_pred_cpp`, plslib, xscale, Xu, dxrxu)
}

#' @keywords internal
#' @noRd
resemble_set_omp_threads <- function(n) {
invisible(.Call(`_resemble_resemble_set_omp_threads`, n))
}

10 changes: 7 additions & 3 deletions R/diss_evaluate.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,22 @@ diss_evaluate <- function(diss, side_info) {
call. = FALSE
)
}
side_info <- as.factor(side_info)
if (nlevels(side_info) < 2L) {
side_info_cat <- as.factor(side_info[, 1])
if (nlevels(side_info_cat) < 2L) {
stop(
"'side_info' must have at least two categories.",
call. = FALSE
)
}
get_eval <- .eval_categorical
get_eval <- function(y, indices_closest)
.eval_categorical(as.matrix(as.factor(y[, 1])), indices_closest)
} else {
get_eval <- .eval_continuous
}




if (any(colSums(!is.na(side_info)) < 4L)) {
stop(
"Each 'side_info' variable must have at least 4 non-missing values.",
Expand Down
15 changes: 8 additions & 7 deletions R/gesearch.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,13 @@
#' of selectivity ratio plot. Chemometrics and Intelligent Laboratory Systems
#' 95:35-48.
#'
#' Ramirez-Lopez, L., Viscarra Rossel, R., Behrens, T., Orellano, C.,
#' Perez-Fernandez, E., Kooijman, L., Wadoux, A. M. J.-C., Breure, T.,
#' Summerauer, L., Safanelli, J. L., & Plans, M. (2026a). When spectral
#' libraries are too complex to search: Evolutionary subset selection for
#' domain-adaptive calibration. \emph{Analytica Chimica Acta}, under review.
#' Ramirez-Lopez, L., Viscarra Rossel, R., Orellano, C.,
#' Kooijman, L., Perez-Fernandez, E., Wadoux, A. M. J.-C.,
#' Plans, M., Breure, T., Summerauer, L., Safanelli, J. L.,
#' Behrens, T., & Boqué, R. (2026a). When spectral libraries
#' are too complex to search: Evolutionary subset selection for
#' domain-adaptive calibration. \emph{Analytica Chimica Acta},
#' 1412, 345651. \doi{10.1016/j.aca.2026.345651}
#'
#' @seealso
#' \code{\link{fit_pls}}, \code{\link{gesearch_control}}, \code{\link{mbl}}
Expand Down Expand Up @@ -995,8 +997,7 @@ gesearch.default <- function(


#' @aliases gesearch
#' @importFrom stats quantile complete.cases diffinv na.pass model.extract
#' model.frame model.matrix
#' @importFrom stats quantile complete.cases diffinv na.pass model.extract model.frame model.matrix
#' @export
gesearch.formula <- function(
formula,
Expand Down
4 changes: 2 additions & 2 deletions R/liblex.R
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@
#' Ramirez-Lopez, L., Metz, M., Lesnoff, M., Orellano, C.,
#' Perez-Fernandez, E., Plans, M., Breure, T., Behrens, T.,
#' Viscarra Rossel, R., & Peng, Y. (2026b). Rethinking local spectral
#' modelling: From per-query refitting to model libraries.
#' \emph{Analytica Chimica Acta}, under review.
#' modelling: From per-query refitting to model libraries.
#' \emph{Analytica Chimica Acta}, 345682. \doi{10.1016/j.aca.2026.345682}
#'
#' Rajalahti, T., Arneberg, R., Berven, F.S., Myhr, K.M., Ulvik, R.J.,
#' Kvalheim, O.M. (2009). Biomarker discovery in mass spectral profiles by
Expand Down
1 change: 1 addition & 0 deletions R/local_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ get_plsr <- function(
#' @author Leonardo Ramirez-Lopez
#' @keywords internal
#' @noRd
#' @export
predict.plsr <- function(object, newdata, ncomp = NULL, ...) {
if (!inherits(object, "plsr")) {
stop("'object' must be of class 'plsr'", call. = FALSE)
Expand Down
17 changes: 10 additions & 7 deletions R/resemble.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,20 @@
#' @title Overview of the functions in the resemble package
#' @references
#'
#' Ramirez-Lopez, L., Viscarra Rossel, R., Behrens, T., Orellano, C.,
#' Perez-Fernandez, E., Kooijman, L., Wadoux, A. M. J.-C., Breure, T.,
#' Summerauer, L., Safanelli, J. L., & Plans, M. (2026a). When spectral
#' libraries are too complex to search: Evolutionary subset selection for
#' domain-adaptive calibration. \emph{Analytica Chimica Acta}, under review.
#'
#' Ramirez-Lopez, L., Viscarra Rossel, R., Orellano, C.,
#' Kooijman, L., Perez-Fernandez, E., Wadoux, A. M. J.-C.,
#' Plans, M., Breure, T., Summerauer, L., Safanelli, J. L.,
#' Behrens, T., & Boqué, R. (2026a). When spectral libraries
#' are too complex to search: Evolutionary subset selection for
#' domain-adaptive calibration. \emph{Analytica Chimica Acta},
#' 1412, 345651. \doi{10.1016/j.aca.2026.345651}
#'
#' Ramirez-Lopez, L., Metz, M., Lesnoff, M., Orellano, C.,
#' Perez-Fernandez, E., Plans, M., Breure, T., Behrens, T.,
#' Viscarra Rossel, R., & Peng, Y. (2026b). Rethinking local spectral
#' modelling: From per-query refitting to model libraries.
#' \emph{Analytica Chimica Acta}, under review.
#' modelling: From per-query refitting to model libraries.
#' \emph{Analytica Chimica Acta}, 345682. \doi{10.1016/j.aca.2026.345682}
#'
#' Ramirez-Lopez, L., Behrens, T., Schmidt, K., Stevens, A., Dematte, J.A.M.,
#' Scholten, T. (2013a). The spectrum-based learner: A new local approach for
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ status](https://www.r-pkg.org/badges/version/resemble?v=2.png)](https://CRAN.R-p

<!-- badges: end -->

*Last update: 2026-04-21*
*Last update: 2026-06-18*

Version: 3.0.0vortex
Version: 3.0.1tarragona

<em>
<p align="right">
Expand Down Expand Up @@ -261,6 +261,24 @@ citation(package = "resemble")

## News: Memory-based learning and `resemble`

- **2026.04:** [Greenberg et al.,
2026](https://doi.org/10.1016/j.geoderma.2026.117829)
used `resemble` for MBL-PLSR modelling of portable X-ray fluorescence
(pXRF) spectra, showing improved soil property predictions relative to
global PLSR across in-situ and ex-situ measurement settings.

- **2026.05:** [Ramirez-Lopez et al.,
2026](https://doi.org/10.1016/j.aca.2026.345682) introduced `liblex`,
a retrieval-gated modelling framework that converts spectral libraries
into libraries of precomputed local experts for scalable memory-based
learning. For this, `resemble` was used.

- **2026.05:** [Ramirez-Lopez et al.,
2026](https://doi.org/10.1016/j.aca.2026.345651) introduced
`gesearch`, an evolutionary subset-selection method for identifying
target-domain-relevant samples from complex spectral libraries. For
this, `resemble` was used.

- **2026.05:** [van Leeuwen et al.,
2026](https://doi.org/10.1016/j.geoderma.2026.117804)
used `resemble` for principal component Mahalanobis nearest-neighbour
Expand Down
8 changes: 8 additions & 0 deletions README.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ citation(package = "resemble")

## News: Memory-based learning and `resemble`

* **2026.04:** [Greenberg et al., 2026](https://doi.org/10.1016/j.geoderma.2026.117829)
used `resemble` for MBL-PLSR modelling of portable X-ray fluorescence (pXRF) spectra, showing improved soil property predictions relative to global PLSR across in-situ and ex-situ measurement settings.

* **2026.05:** [Ramirez-Lopez et al., 2026](https://doi.org/10.1016/j.aca.2026.345682)
introduced `liblex`, a retrieval-gated modelling framework that converts spectral libraries into libraries of precomputed local experts for scalable memory-based learning. For this, `resemble` was used.

* **2026.05:** [Ramirez-Lopez et al., 2026](https://doi.org/10.1016/j.aca.2026.345651)
introduced `gesearch`, an evolutionary subset-selection method for identifying target-domain-relevant samples from complex spectral libraries. For this, `resemble` was used.

* **2026.05:** [van Leeuwen et al., 2026](https://doi.org/10.1016/j.geoderma.2026.117804)
used `resemble` for principal component Mahalanobis nearest-neighbour search to extract spectrally similar samples from the KSSL library for MIR model calibration in Dutch soils.
Expand Down
12 changes: 7 additions & 5 deletions man/gesearch.Rd

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

2 changes: 1 addition & 1 deletion man/liblex.Rd

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

2 changes: 1 addition & 1 deletion man/mbl.Rd

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

14 changes: 8 additions & 6 deletions man/resemble-package.Rd

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

50 changes: 50 additions & 0 deletions my-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
# version 3.0.1

Dear CRAN maintainers,

This is a resubmission of resemble 3.0.1. The previous submission was held up
by two NOTEs about CPU/elapsed time ratio in tests and vignettes. Both have
been resolved by capping OpenMP threads via `OMP_THREAD_LIMIT` and
`OMP_NUM_THREADS` in `tests/testthat/setup.R` and in the affected vignette
setup chunks.

## Test environments
- Ubuntu 24.04, R 4.5.3 (local)
- winbuilder R-release: 0 errors, 0 warnings, 0 notes
- winbuilder R-oldrelease: 0 errors, 0 warnings, 0 notes
- winbuilder R-devel: likely false positive ERROR — known incompatibility
between Rcpp 1.1.1 and R 4.6.0 RC (R_NamespaceRegistry removed from R API),
affecting all Rcpp-dependent packages. See:
https://github.com/RcppCore/Rcpp/issues/1473
Debian R-devel passes with Status: OK.

Best regards,
Leo

The package was tested locally:

devtools::check(
args = "--as-cran",
env_vars = c(
`_R_CHECK_CRAN_INCOMING_` = "true",
`_R_CHECK_CRAN_INCOMING_REMOTE_` = "true"
)
)

❯ checking compilation flags used ... NOTE
Compilation used the following non-portable flag(s):
‘-mno-omit-leaf-frame-pointer’

0 errors ✔ | 0 warnings ✔ | 1 note ✖

The package was built using:

devtools::install()

devtools::build(
vignettes = TRUE,
manual = TRUE,
clean_doc = FALSE
)


# version 3.0.0

Dear CRAN maintainers,
Expand Down
Binary file added pkgdown/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions pkgdown/favicon/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions pkgdown/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Binary file added pkgdown/favicon/web-app-manifest-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/web-app-manifest-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading