Skip to content

Commit

Permalink
Merge pull request #75 from r-hyperspec/feature-38/rename-functions
Browse files Browse the repository at this point in the history
Feature 38/rename functions
  • Loading branch information
GegznaV authored Dec 14, 2021
2 parents 15b6c05 + e7a0d09 commit c58d983
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 35 additions & 0 deletions R/DEPRECATED-markpeak.R
Original file line number Diff line number Diff line change
@@ -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"))
})
}
2 changes: 1 addition & 1 deletion R/DEPRECATED-read.spe.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions R/mark_peak.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c58d983

Please sign in to comment.