Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 38/rename functions (44) #75

Merged
merged 5 commits into from
Dec 14, 2021
Merged
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
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