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

> ### Name: ROChange
> ### Title: ROC curve for changepoints
> ### Aliases: ROChange
> 
> ### ** Examples
> 
> 
>   library(penaltyLearning)
>   library(data.table)

Attaching package: ‘data.table’

The following object is masked from ‘package:base’:

    %notin%

> 
>   data(neuroblastomaProcessed, envir=environment())
>   ## Get incorrect labels data for one profile.
>   pid <- 11
>   pro.errors <- neuroblastomaProcessed$errors[
+     profile.id==pid][order(chromosome, min.log.lambda)]
>   dcast(pro.errors, n.segments ~ chromosome, value.var="errors")
Key: <n.segments>
    n.segments     1     2     3     4    11    17
         <int> <num> <num> <num> <num> <num> <num>
 1:          1     1     0     0     1     0     0
 2:          2     0     0    NA     0     0     1
 3:          3     0     0     1     0    NA    NA
 4:          4    NA    NA    NA    NA     1    NA
 5:          5     0     1     1     0     1     1
 6:          6     0     1    NA    NA     1     1
 7:          7    NA     1     1     0     1     1
 8:          8     0     1     1     0     1    NA
 9:          9    NA     1    NA    NA     1     1
10:         10     0    NA     1    NA    NA     1
11:         11     0    NA     1    NA     1     1
12:         12    NA    NA     1     0    NA     1
13:         13    NA     1    NA     0     1     1
14:         14    NA     1    NA    NA     1     1
15:         15     0     1     1     0     1     1
16:         16    NA    NA     1     0     1    NA
17:         17    NA     1    NA     0     1     1
18:         18     0    NA     1     0     1     1
19:         19     0     1     1     0     1    NA
20:         20     0     1     1     0     1     1
    n.segments     1     2     3     4    11    17
>   ## Get the feature that corresponds to the BIC penalty = log(n),
>   ## meaning log(penalty) = log(log(n)).
>   chr.vec <- paste(c(1:4, 11, 17))
>   pid.names <- paste0(pid, ".", chr.vec)
>   BIC.feature <- neuroblastomaProcessed$feature.mat[pid.names, "log2.n"]
>   pred <- data.table(pred.log.lambda=BIC.feature, chromosome=chr.vec)
>   ## edit one prediction so that it ends up having the same threshold
>   ## as another one, to illustrate an aum sub-differential with
>   ## un-equal lo/hi bounds.
>   err.changes <- pro.errors[, {
+     .SD[c(NA, diff(errors) != 0), .(min.log.lambda)]
+   }, by=chromosome]
>   (ch.vec <- err.changes[, structure(min.log.lambda, names=chromosome)])
         1          2          3          4         11         17 
 2.3947329 -0.4565704 -0.2495940  0.7307934  0.5528004  1.0369324 
>   other <- "11"
>   (diff.other <- ch.vec[[other]]-pred[other, pred.log.lambda, on=.(chromosome)])
[1] -1.075214
>   pred["1", pred.log.lambda := ch.vec[["1"]]-diff.other, on=.(chromosome)]
>   pred["4", pred.log.lambda := 2, on=.(chromosome)]
>   ch.vec[["1"]]-pred["1", pred.log.lambda, on=.(chromosome)]
[1] -1.075214
>   result <- ROChange(pro.errors, pred, "chromosome")
Error in `[.data.table`(err, , `:=`(next.min, c(min.log.lambda[-1], Inf)),  : 
  attempt access index 15/15 in VECTOR_ELT
Calls: ROChange -> [ -> [.data.table
Execution halted