From 14cb619997719aac2971b5ef89feacc421764458 Mon Sep 17 00:00:00 2001 From: Chris Sobczak Date: Wed, 10 Jun 2026 20:54:26 -0700 Subject: Update docs --- R/rsc.R | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'R/rsc.R') diff --git a/R/rsc.R b/R/rsc.R index b46ae84..025ec0b 100644 --- a/R/rsc.R +++ b/R/rsc.R @@ -39,19 +39,22 @@ rsc <- function(cv, threshold = "minimum", weights = NULL){ } } + # make a copy + rmadvec <- cv$rmadvec + ## threshold the rmadvec if(is.null(weights)){ - cv$rmadvec[ abs(cv$rmadvec) < threshold ] <- 0 + rmadvec[ abs(rmadvec) < threshold ] <- 0 }else{ - T <- abs(cv$rmadvec) * weights - cv$rmadvec[ T < threshold ] <- 0 + T <- abs(rmadvec) * weights + rmadvec[ T < threshold ] <- 0 } - nc <- length(cv$rmadvec) + nc <- length(rmadvec) p <- {1 + sqrt( 1 + 8 * nc ) } / 2 R <- Matrix(1, nrow = p, ncol = p, sparse = TRUE) - R[lower.tri(R , diag = FALSE)] <- cv$rmadvec + R[lower.tri(R , diag = FALSE)] <- rmadvec R <- forceSymmetric(R , uplo="L") ## attach dimnames if needed -- cgit v1.2.3