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' 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 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")) + }) +} 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)