diff options
| author | Chris Sobczak <chris@sobczak.family> | 2026-06-10 20:54:26 -0700 |
|---|---|---|
| committer | Chris Sobczak <chris@sobczak.family> | 2026-06-10 20:54:26 -0700 |
| commit | 14cb619997719aac2971b5ef89feacc421764458 (patch) | |
| tree | 89c90e84b40579d67c0ad72811f2b1719ff70f46 /R | |
| parent | cbed2931c9244daa2e1e8d4c0b13958f8e5e0148 (diff) | |
Update docs
Diffstat (limited to 'R')
| -rw-r--r-- | R/rsc.R | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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 |
