@@ -119,20 +119,21 @@ test_that("Check input: nj", {
119119
120120 # ## nj has non-integer
121121 nj1 <- nj.test
122-
123122 nj1 [1 ] <- pi
124123 expect_error(ccdr_singleR(cors = cors.test , pp = pp , nn = nn , nj = nj1 , betas = betas.test , sigmas = sigmas.test , lambda = lambda.test , weights = weights.test , gamma = gamma.test , eps = eps.test , maxIters = maxIters.test , alpha = alpha.test ),
125124 " Intervention times vector has non-integer" )
126-
125+ nj1 <- nj.test
127126 nj1 [1 ] <- NA
128127 expect_error(ccdr_singleR(cors = cors.test , pp = pp , nn = nn , nj = nj1 , betas = betas.test , sigmas = sigmas.test , lambda = lambda.test , weights = weights.test , gamma = gamma.test , eps = eps.test , maxIters = maxIters.test , alpha = alpha.test ),
129- " Intervention times vector has non-integer " )
128+ " Intervention times vector cannot have missing or NULL " )
130129
131130 # ## nj out of bound
131+ nj1 <- nj.test
132132 nj1 <- rep(- 1L , pp )
133133 expect_error(ccdr_singleR(cors = cors.test , pp = pp , nn = nn , nj = nj1 , betas = betas.test , sigmas = sigmas.test , lambda = lambda.test , weights = weights.test , gamma = gamma.test , eps = eps.test , maxIters = maxIters.test , alpha = alpha.test ),
134134 " Intervention times vector has out-of-range" )
135135
136+ nj1 <- nj.test
136137 nj1 <- as.integer(rep(nn + 1 , pp ))
137138 expect_error(ccdr_singleR(cors = cors.test , pp = pp , nn = nn , nj = nj1 , betas = betas.test , sigmas = sigmas.test , lambda = lambda.test , weights = weights.test , gamma = gamma.test , eps = eps.test , maxIters = maxIters.test , alpha = alpha.test ),
138139 " Intervention times vector has out-of-range" )
0 commit comments