Skip to content

Commit

Permalink
fix: predict.bassetfit now accepts newdata=NULL argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jsilve24 authored and michellepistner committed May 3, 2024
1 parent 36adb3d commit 006426c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/bassetfit_s3.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ verify.bassetfit <- function(m, ...){
#'
#' @export
#' @importFrom stats median predict runif
predict.bassetfit <- function(object, newdata, response="Lambda", size=NULL,
predict.bassetfit <- function(object, newdata=NULL, response="Lambda", size=NULL,
use_names=TRUE, summary=FALSE, iter=NULL,
from_scratch=FALSE, ...){
req(object, c("Lambda", "Sigma"))
if (is.null(newdata)) {
req(object, c("X"))
newdata <- object$X
}
newdata <- vec_to_mat(newdata)

l <- store_coord(object)
Expand Down Expand Up @@ -198,4 +202,4 @@ predict.bassetfit <- function(object, newdata, response="Lambda", size=NULL,
}
if (response=="Y") return(Ypred)
stop("response parameter not recognized")
}
}

0 comments on commit 006426c

Please sign in to comment.