Skip to content

Commit

Permalink
Don't use built-in |> to facilitate support for earlier versions of R.
Browse files Browse the repository at this point in the history
closes #27
  • Loading branch information
krivit committed Sep 14, 2023
1 parent f493236 commit da0c2e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/matrix.utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ xTAx_ssolve <- function(x, A, ...) {
#' @export
xTAx_qrssolve <- function(x, A, tol = 1e-07, ...) {
d <- diag(as.matrix(A))
d <- ifelse(d==0, 1, 1/d) |> sqrt()
d <- sqrt(ifelse(d==0, 1, 1/d))

if(anyNA(d)) stop("Matrix x has negative elements on the diagonal.")
dd <- rep(d, each = length(d)) * d
Expand Down

0 comments on commit da0c2e0

Please sign in to comment.