Skip to content

Commit

Permalink
better warning for non numeric vector in wavenumbers
Browse files Browse the repository at this point in the history
  • Loading branch information
wincowgerDEV committed Aug 25, 2023
1 parent 9908782 commit be48968
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion R/as_OpenSpecy.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ as_OpenSpecy.default <- function(x, spectra,
coords = "gen_grid",
session_id = FALSE,
...) {
if (!is.numeric(x) && !is.complex(x) && !is.vector(x))
if (!is.numeric(x) || !is.complex(x) || !is.vector(x))
stop("'x' must be numeric vector", call. = F)
if (!inherits(spectra, c("data.frame", "matrix")))
stop("'spectra' must inherit from data.frame or matrix", call. = F)
Expand Down
6 changes: 3 additions & 3 deletions R/manage_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,21 @@ c_spec.list <- function(x, range = NULL, res = 5, ...) {
}


#' @rdname process_spec
#' @rdname manage_spec
#'
#' @export
sample_spec <- function(x, ...) {
UseMethod("sample_spec")
}

#' @rdname process_spec
#' @rdname manage_spec
#'
#' @export
sample_spec.default <- function(x, ...) {
stop("object 'x' needs to be of class 'OpenSpecy'")
}

#' @rdname process_spec
#' @rdname manage_spec
#'
#' @export
sample_spec.OpenSpecy <- function(x, ...) {
Expand Down
3 changes: 3 additions & 0 deletions R/match_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,6 @@ filter_spec.OpenSpecy <- function(x, logic, ...) {

return(x)
}



9 changes: 9 additions & 0 deletions man/manage_spec.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions man/process_spec.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit be48968

Please sign in to comment.