Skip to content

Commit 1951488

Browse files
Update error msgs
1 parent 5860e48 commit 1951488

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/ccdrAlgorithm-main.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ ccdr_singleR <- function(cors,
442442

443443
### Check sigmas
444444
if(!is.numeric(sigmas)) stop("sigmas must be numeric!")
445+
if(length(sigmas) != pp) stop(sprintf("sigmas must have length = %d!", pp))
445446
if(any(sigmas < 0)){
446447
# -1 is a sentinel value for updating sigmas via the CD updates
447448
if(any(sigmas != -1.)){
@@ -454,7 +455,7 @@ ccdr_singleR <- function(cors,
454455
if(lambda < 0) stop("lambda must be >= 0!")
455456

456457
### Check weights
457-
if(length(weights) != pp*pp) stop("weights must have length p^2!")
458+
if(length(weights) != pp*pp) stop(sprintf("weights must have length p^2 = %d!", pp*pp))
458459
if(!is.numeric(weights)) stop("weights must be numeric!")
459460
if(weights < -1 || weights > 1) stop("weights out of bounds!")
460461

0 commit comments

Comments
 (0)