Running examples in ‘randomizeR-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: assess
> ### Title: Assessing randomization sequences
> ### Aliases: assess assess assess,randSeq,missing-method
> ###   assess,randSeq,endpoint-method
> 
> ### ** Examples
> 
> # assess the full set of Random Allocation Rule for N=4 patients
> sequences <- getAllSeq(rarPar(4))
> issue1 <- corGuess("CS")
> issue2 <- corGuess("DS")
> issue3 <- imbal("imb")
> issue4 <- imbal("maxImb")
> assess(sequences, issue1, issue2, issue3, issue4)

Assessment of a randomization procedure 

design = RAR 
N = 4 
K = 2 
groups = A B 


The first 3 rows of 6 rows of D: 

  Sequence Probability propCG(CS) propCG(DS) imb maxImb
1     BBAA       0.167      0.625      0.375   0      2
2     BABA       0.167      0.750      0.250   0      1
3     ABBA       0.167      0.750      0.250   0      1
...
> 
> # assess one sequence of the Big Stick Design with respect to correct guesses
> sequence <- genSeq(bsdPar(10, 2), seed = 1909)
> assess(sequence, issue1)

Assessment of a randomization procedure 

design = BSD(2) 
N = 10 
K = 2 
groups = A B 

       Sequence Relative_Frequency propCG(CS)
1 AABBABBAA ...                  1        0.7

> 
> # assess the same sequence with respect to selection bias
> endp <- normEndp(c(2, 2), c(1, 1))
> issue5 <- selBias("CS", 4, "exact")
> issue6 <- setPower(2, "exact")
> assess(sequence, issue1, issue5, issue6, endp = endp)

Assessment of a randomization procedure 

design = BSD(2) 
N = 10 
K = 2 
groups = A B 

       Sequence Relative_Frequency propCG(CS) P(rej)(CS) power(exact)
1 AABBABBAA ...                  1        0.7      0.262        0.791

> 
> # recommended plot for the assessment of rejection probabilities
> RP <- getAllSeq(crPar(6))
> cB <- chronBias(type = "linT", theta = 1/6, method = "exact")
> sB <- selBias(type=  "CS", eta = 1/4, method = "exact")
> normEndp <- normEndp(c(0, 0), c(1, 1))
> A <- assess(RP, cB, sB, endp = normEndp)
> D <- A$D
> desiredSeq <- round(sum(D[,2][D[,3] <= 0.05 & D[,4] <= 0.05]), digits = 4)
> colnames(D) <- c("Seq", "Prob", "SB", "linT")
> g <- ggplot(D, aes(x = SB, y = linT))
> g <- g + annotate("rect", xmin = 0, xmax = 0.05, ymin = 0, ymax = 0.05,
+ alpha=0.2, fill="green") 
> g <- g + geom_point(alpha = 1/10, size = 3, col = "orange")
> g <- g <- g + geom_vline(xintercept = 0.05, col = "red")
> g <- g + geom_hline(yintercept = 0.05, col = "red")
> g  <- g + geom_text(data = NULL, x = 0, y = 0,
+ label = paste("Proportion:", desiredSeq), hjust=0, vjust=0, size = 7)
> g
Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
Calls: <Anonymous> ... lapply -> FUN -> push.vp.viewport -> grid.Call.graphics
Execution halted