Skip to content

v2.2.9 - proxy

Choose a tag to compare

@l-ramirez-lopez l-ramirez-lopez released this 31 May 14:41
· 27 commits to main since this release
ceb11b5

Bug fixes

  • continuumRemoval(): fixed NA values produced for spectra with very low
    reflectance in the first bands and high NIR reflectance. The fixed boundary
    offset of 1 wavelength unit used in the internal convex hull computation was
    too large for spectra with fine spectral resolution or wavelengths expressed
    in units other than nanometres. The offset is now derived from the actual
    spectral resolution at each edge, making the behaviour unit-agnostic
    (reported by @jbferet,
    #80).

  • continuumRemoval(): fixed NaN produced at the first wavelength when its
    reflectance value is exactly zero. The continuum-removed value is now set to
    1 (no absorption feature) at bands where both the spectrum and the continuum
    are zero
    (#80).

  • continuumRemoval(): corrected a long-standing typo in the method
    argument: "substraction" has been replaced by "subtraction". A
    deprecation warning is issued if the old spelling is passed explicitly.

  • standardNormalVariate(): zero-variance rows (e.g. constant spectra) are
    now handled silently by returning zero rather than NaN or raising an
    error. Single spectra passed as a numeric vector are now also accepted and
    coerced to a one-row matrix before processing.

  • readASD(): fixed a file-connection leak (the binary connection was not
    closed on early exit); fixed a missing output branch in the txt-format path
    when the position index is greater than 2, which silently dropped spectra.

  • read_nircal(): fixed a file-connection leak (connection was only closed
    inside a progress-reporting branch, leaving it open otherwise).

  • cochranTest(): fixed an invalid argument name in both prcomp() calls
    (.scale = FALSEscale. = FALSE), which produced spurious warnings and
    incorrect PC scores.

  • continuumRemoval(): removed an erroneous @export tag from the internal
    helper cr_fun(), which caused an "undocumented object" NOTE in
    R CMD check.

New features

  • standardNormalVariate(): now accepts a single spectrum passed as a numeric
    vector, which is coerced to a one-row matrix before processing.

  • detrend(): added snv argument (default TRUE) to allow polynomial
    detrending without a prior SNV transformation. The default behaviour is
    unchanged and remains consistent with Barnes et al. (1989). Set snv = FALSE to apply pure polynomial detrending independently of SNV, for
    example as a separate step in a pre-processing pipeline.

  • The vignette has been reorganised into three separate vignettes with
    extended examples: (1) an introduction to the package, (2) signal
    processing, and (3) calibration sampling.

Documentation

  • spliceCorrection(): clarified that wav must be a numeric vector of
    length equal to ncol(X), not a two-element range vector
    (#69).

  • duplex(): a warning is now issued when k exceeds floor(nrow(X) / 2),
    the maximum number of samples selectable per set. Previously, k was
    silently capped to this limit with no indication to the user (reported by
    @georgejr45).