From e1a14011ca0f64b135d55d85ef9772f96d249e95 Mon Sep 17 00:00:00 2001
From: "Pavel N. Krivitsky"
Date: Thu, 14 Sep 2023 15:57:40 -0700
Subject: [PATCH] Don't use built-in |> to facilitate support for earlier
versions of R.
---
R/matrix.utils.R | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/R/matrix.utils.R b/R/matrix.utils.R
index f346e19..f02ae27 100644
--- a/R/matrix.utils.R
+++ b/R/matrix.utils.R
@@ -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