Skip to content
Open
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
4 changes: 3 additions & 1 deletion R/pls.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@
x <- as.matrix(x)
}
z <- sweep(x, 2, STATS = object$mu, "-")
z <- sweep(z, 2, STATS = object$sd, "/")
if (!is.null(object$sd)) {
z <- sweep(z, 2, STATS = object$sd, "/")

Check warning on line 322 in R/pls.R

View check run for this annotation

Codecov / codecov/patch

R/pls.R#L321-L322

Added lines #L321 - L322 were not covered by tests
}
res <- z %*% object$coefs
res <- tibble::as_tibble(res)
res <- purrr::map2_dfc(res, object$col_norms, \(.x, .y) .x * .y)
Expand Down