Skip to content

Commit

Permalink
refacto: use inherits
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin62 committed May 15, 2022
1 parent 91c1c9f commit 60ffab1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/LarsPath.R
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ coef.LarsPath <- function(object, index = NULL, mode = c("lambda", "step", "frac
if (missing(index) || is.null(index)) {
stop("index is missing.")
}
if (class(object) != "LarsPath") {
if (!inherits(object, "LarsPath")) {
stop("object must be a LarsPath object")
}

Expand Down
2 changes: 1 addition & 1 deletion R/predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ predict.LarsPath <- function(object, Xnew, lambda, mode = c("fraction", "lambda"
if (missing(object)) {
stop("object is missing.")
}
if (class(object) != "LarsPath") {
if (!inherits(object, "LarsPath")) {
stop("object must be a LarsPath object.")
}

Expand Down

0 comments on commit 60ffab1

Please sign in to comment.