Skip to content

Commit

Permalink
fix assert() fxn to use !inherits() instead of x in y
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Oct 10, 2019
1 parent bef0702 commit 060bc6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ rvc <- function(x) Filter(Negate(is.null), x)

assert <- function(x, y) {
if (!is.null(x)) {
if (!class(x) %in% y) {
if (!inherits(x, y)) {
stop(deparse(substitute(x)), " must be of class ",
paste0(y, collapse = ", "), call. = FALSE)
}
Expand Down

0 comments on commit 060bc6e

Please sign in to comment.