From 3ffce6b31649f2c9b147c586c32fe5b8c50ca8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilmantas=20G=C4=97g=C5=BEna?= Date: Tue, 14 Dec 2021 23:13:08 +0200 Subject: [PATCH 1/4] =?UTF-8?q?Rename=20markpeak=20=E2=86=92=20mark=5Fpeak?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/DEPRECATED-read.spe.R | 2 +- R/mark_peak.R | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/DEPRECATED-read.spe.R b/R/DEPRECATED-read.spe.R index 04b26d60..f96fc796 100644 --- a/R/DEPRECATED-read.spe.R +++ b/R/DEPRECATED-read.spe.R @@ -346,7 +346,7 @@ spe.showcalpoints <- function(filename, xaxis = "file", acc2avg = F, cts_sec = F return("") } - markpeak(spc, wl_convert_units( + mark_peak(spc, wl_convert_units( from = hdr$xCalInputUnit, to = .wl_fix_unit_name(xaxis), x = hdr$xCalValues, diff --git a/R/mark_peak.R b/R/mark_peak.R index 6d689d38..b5ac16dd 100644 --- a/R/mark_peak.R +++ b/R/mark_peak.R @@ -16,8 +16,8 @@ #' @export #' @examples #' plot(faux_cell[7]) -#' markpeak(faux_cell[7], 1662) -markpeak <- function(spc, xpos, col = "red") { +#' mark_peak(faux_cell[7], 1662) +mark_peak <- function(spc, xpos, col = "red") { assert_hyperSpec(spc) validObject(spc) From 890bf0fcfc4fd38a8a29c9eb8c3311c2c1d6107e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilmantas=20G=C4=97g=C5=BEna?= Date: Tue, 14 Dec 2021 23:13:19 +0200 Subject: [PATCH 2/4] Deprecate markpeak --- R/DEPRECATED-markpeak.R | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 R/DEPRECATED-markpeak.R diff --git a/R/DEPRECATED-markpeak.R b/R/DEPRECATED-markpeak.R new file mode 100644 index 00000000..c7b3b8be --- /dev/null +++ b/R/DEPRECATED-markpeak.R @@ -0,0 +1,35 @@ +#' @name DEPRECATED-markpeak +#' @concept deprecated +#' +#' @title (DEPRECATED) +#' Find an evenly spaced grid for x +#' +#' @description +#' These \pkg{hyperSpec} functions are **deprecated** and not maintained any +#' more. You should not use these. +#' Currently they are present due to back-compatibility reasons and will be +#' removed in the next release of the package. +#' Please, use the suggested alternative functions instead: +#' +#' - [hyperSpec::mark_peak()] +#' +#' +#' @param ... arguments to [hyperSpec::mark_peak()]. +#' +#' @include mark_peak.R +#' @export +markpeak <- function(...) { + hySpc_deprecated("mark_peak") + mark_peak(...) +} + + +# Unit tests ----------------------------------------------------------------- + +hySpc.testthat::test(markpeak) <- function() { + context("Deprecated functions") + + test_that("markpeak() is deprecated", { + expect_error(expect_warning(markpeak(), "deprecated")) + }) +} From 2a46b58a41e98d1ad74cd064f51cfd85cc5655d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilmantas=20G=C4=97g=C5=BEna?= Date: Tue, 14 Dec 2021 23:13:32 +0200 Subject: [PATCH 3/4] Update DESCRIPTION #44 --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d56d2d17..d607e015 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -98,6 +98,8 @@ Collate: 'DEPRECATED-ggplot2.R' 'DEPRECATED-hy_options.R' 'DEPRECATED-isample.R' + 'mark_peak.R' + 'DEPRECATED-markpeak.R' 'cov_pooled.R' 'DEPRECATED-pooled.cov.R' 'raster.R' @@ -178,7 +180,6 @@ Collate: 'levelplot.R' 'map_identify.R' 'mark_groups_in_dendrogram.R' - 'mark_peak.R' 'mean_sd.R' 'merge.R' 'mergeextra.R' From e7a0d09a9cc6b8d3b58a2f1a7ec443d12e78b459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilmantas=20G=C4=97g=C5=BEna?= Date: Tue, 14 Dec 2021 23:13:42 +0200 Subject: [PATCH 4/4] Update NEWS.md #44 --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index f9309f6b..04620056 100644 --- a/NEWS.md +++ b/NEWS.md @@ -36,6 +36,7 @@ `hy.getOptions()` | `hy_get_options()` | #21 `hy.setOptions()` | `hy_set_options()` | #21 `makeraster()` | `raster_make()` | #47 + `markpeak()` | `mark_peak()` | #44 `matlab.dark.palette()` | `palette_matlab_dark()` | cbeleites/hyperSpec#299, cbeleites/hyperSpec#299, @sangttruong `matlab.palette()` | `palette_matlab()` | cbeleites/hyperSpec#208, cbeleites/hyperSpec#299, @sangttruong `mergeextra()` | `merge_data()` | cbeleites/hyperSpec#208, cbeleites/hyperSpec#302