Last updated on 2026-10-24 12:51:31 CEST.
| Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
|---|---|---|---|---|---|---|
| r-devel-linux-x86_64-debian-clang | 2.66 | 23.25 | 426.25 | 449.50 | OK | |
| r-devel-linux-x86_64-debian-gcc | 2.66 | 15.62 | 277.22 | 292.84 | ERROR | |
| r-devel-linux-x86_64-fedora-clang | 2.66 | 18.00 | 329.64 | 347.64 | OK | |
| r-devel-linux-x86_64-fedora-gcc | 2.66 | 16.00 | 310.68 | 326.68 | OK | |
| r-devel-windows-x86_64 | 2.66 | 54.00 | 341.00 | 395.00 | OK | --no-vignettes |
| r-patched-linux-x86_64 | 2.66 | 28.00 | 396.00 | 424.00 | OK | |
| r-release-linux-x86_64 | 2.66 | 20.76 | 391.66 | 412.42 | OK | |
| r-release-macos-arm64 | 2.66 | 6.00 | 117.00 | 123.00 | OK | |
| r-release-macos-x86_64 | 2.66 | 17.00 | 541.00 | 558.00 | OK | |
| r-release-windows-x86_64 | 2.66 | 31.00 | 263.00 | 294.00 | OK | --no-vignettes |
| r-oldrel-macos-arm64 | 2.66 | 5.00 | 116.00 | 121.00 | OK | |
| r-oldrel-macos-x86_64 | 2.66 | 17.00 | 656.00 | 673.00 | OK | |
| r-oldrel-windows-x86_64 | 2.66 | 40.00 | 299.00 | 339.00 | OK | --no-vignettes |
Version: 2.66
Check: examples
Result: ERROR
Running examples in ‘Epi-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: simLexis
> ### Title: Simulate a Lexis object representing follow-up in a multistate
> ### model.
> ### Aliases: simLexis nState pState plot.pState lines.pState
> ### Keywords: survival
>
> ### ** Examples
>
> data(DMlate)
> dml <- Lexis( entry = list(Per=dodm, Age=dodm-dobth, DMdur=0 ),
+ exit = list(Per=dox),
+ exit.status = factor(!is.na(dodth),labels=c("DM","Dead")),
+ data = DMlate[runif(nrow(DMlate))<0.1,] )
NOTE: entry.status has been set to "DM" for all.
NOTE: Dropping 1 rows with duration of follow up < tol
> # Split follow-up at insulin, introduce a new timescale,
> # and split non-precursor states
> dmi <- cutLexis( dml, cut = dml$doins,
+ pre = "DM",
+ new.state = "Ins",
+ new.scale = "t.Ins",
+ split.states = TRUE )
> # Split the follow in 1-year intervals for modelling
> Si <- splitLexis( dmi, 0:30/2, "DMdur" )
> # Define knots
> nk <- 4
> ( ai.kn <- with( subset(Si,lex.Xst=="Ins"),
+ quantile( Age+lex.dur, probs=(1:nk-0.5)/nk ) ) )
12.5% 37.5% 62.5% 87.5%
31.03046 51.55677 62.61931 75.34796
> ( ad.kn <- with( subset(Si,lex.Xst=="Dead"),
+ quantile( Age+lex.dur, probs=(1:nk-0.5)/nk ) ) )
12.5% 37.5% 62.5% 87.5%
65.49350 75.84736 81.43018 88.42266
> ( di.kn <- with( subset(Si,lex.Xst=="Ins"),
+ quantile( DMdur+lex.dur, probs=(1:nk-0.5)/nk ) ) )
12.5% 37.5% 62.5% 87.5%
1.421629 4.000000 7.000000 10.500000
> ( dd.kn <- with( subset(Si,lex.Xst=="Dead"),
+ quantile( DMdur+lex.dur, probs=(1:nk-0.5)/nk ) ) )
12.5% 37.5% 62.5% 87.5%
0.325462 2.014716 4.240931 8.312799
> ( td.kn <- with( subset(Si,lex.Xst=="Dead(Ins)"),
+ quantile( t.Ins+lex.dur, probs=(1:nk-0.5)/nk ) ) )
12.5% 37.5% 62.5% 87.5%
0.1861739 0.8966461 2.7412731 5.0746064
>
> # Fit Poisson models to transition rates
> library( splines )
> DM.Ins <- glm( (lex.Xst=="Ins") ~ Ns( Age , knots=ai.kn ) +
+ Ns( DMdur, knots=di.kn ) +
+ I(Per-2000) + sex,
+ family=poisson, offset=log(lex.dur),
+ data = subset(Si,lex.Cst=="DM") )
> DM.Dead <- glm( (lex.Xst=="Dead") ~ Ns( Age , knots=ad.kn ) +
+ Ns( DMdur, knots=dd.kn ) +
+ I(Per-2000) + sex,
+ family=poisson, offset=log(lex.dur),
+ data = subset(Si,lex.Cst=="DM") )
> Ins.Dead <- glm( (lex.Xst=="Dead(Ins)") ~ Ns( Age , knots=ad.kn ) +
+ Ns( DMdur, knots=dd.kn ) +
+ Ns( t.Ins, knots=td.kn ) +
+ I(Per-2000) + sex,
+ family=poisson, offset=log(lex.dur),
+ data = subset(Si,lex.Cst=="Ins") )
>
> # Stuff the models into an object representing the transitions
> Tr <- list( "DM" = list( "Ins" = DM.Ins,
+ "Dead" = DM.Dead ),
+ "Ins" = list( "Dead(Ins)" = Ins.Dead ) )
> lapply( Tr, names )
$DM
[1] "Ins" "Dead"
$Ins
[1] "Dead(Ins)"
>
> # Define an initial object - note the subsetting that ensures that
> # all attributes are carried over
> ini <- Si[1,1:9][-1,]
> ini[1:2,"lex.Cst"] <- "DM"
> ini[1:2,"Per"] <- 1995
> ini[1:2,"Age"] <- 60
> ini[1:2,"DMdur"] <- 5
> ini[1:2,"sex"] <- c("M","F")
> str(ini)
Classes ‘Lexis’ and 'data.frame': 2 obs. of 9 variables:
$ lex.id : int NA NA
$ Per : num 1995 1995
$ Age : num 60 60
$ DMdur : num 5 5
$ t.Ins : num NA NA
$ lex.dur: num NA NA
$ lex.Cst: Factor w/ 4 levels "DM","Ins","Dead",..: 1 1
$ lex.Xst: Factor w/ 4 levels "DM","Ins","Dead",..: NA NA
$ sex : Factor w/ 2 levels "M","F": 1 2
- attr(*, "time.scales")= chr [1:4] "Per" "Age" "DMdur" "t.Ins"
- attr(*, "time.since")= chr [1:4] "" "" "" "Ins"
- attr(*, "breaks")=List of 4
..$ Per : NULL
..$ Age : NULL
..$ DMdur: num [1:31] 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 ...
..$ t.Ins: NULL
>
> # Simulate 200 of each sex using the estimated models in Tr
> simL <- simLexis( Tr, ini, time.pts=seq(0,11,0.5), N=200 )
> summary( simL )
Transitions:
To
From DM Ins Dead Dead(Ins) Records: Events: Risk time: Persons:
DM 186 108 106 0 400 214 3079.41 400
Ins 0 78 0 30 108 30 660.40 108
Sum 186 186 106 30 508 244 3739.80 400
>
> # Find the number of persons in each state at a set of times.
> # Note that the times are shirter than the time-span simulated.
> nSt <- nState( subset(simL,sex=="M"),
+ at=seq(0,10,0.1), from=1995, time.scale="Per" )
> nSt
State
when DM Ins Dead Dead(Ins)
1995 200 0 0 0
1995.1 200 0 0 0
1995.2 200 0 0 0
1995.3 200 0 0 0
1995.4 200 0 0 0
1995.5 199 1 0 0
1995.6 198 1 1 0
1995.7 197 1 2 0
1995.8 196 2 2 0
1995.9 194 4 2 0
1996 193 5 2 0
1996.1 190 6 4 0
1996.2 188 7 5 0
1996.3 188 7 5 0
1996.4 187 8 5 0
1996.5 186 9 5 0
1996.6 183 10 7 0
1996.7 181 10 8 1
1996.8 181 10 8 1
1996.9 180 11 8 1
1997 179 12 8 1
1997.1 174 16 9 1
1997.2 171 19 9 1
1997.3 170 20 9 1
1997.4 169 21 9 1
1997.5 167 22 10 1
1997.6 166 23 10 1
1997.7 162 27 10 1
1997.8 162 27 10 1
1997.9 158 29 12 1
1998 156 30 13 1
1998.1 154 32 13 1
1998.2 151 33 15 1
1998.3 151 33 15 1
1998.4 150 34 15 1
1998.5 148 36 15 1
1998.6 147 37 15 1
1998.7 143 39 17 1
1998.8 141 40 18 1
1998.9 141 40 18 1
1999 136 43 20 1
1999.1 136 42 20 2
1999.2 136 42 20 2
1999.3 135 42 20 3
1999.4 135 42 20 3
1999.5 134 43 20 3
1999.6 133 44 20 3
1999.7 132 44 21 3
1999.8 129 45 23 3
1999.9 125 47 25 3
2000 124 48 25 3
2000.1 124 48 25 3
2000.2 123 48 25 4
2000.3 123 48 25 4
2000.4 123 48 25 4
2000.5 123 48 25 4
2000.6 123 46 25 6
2000.7 121 48 25 6
2000.8 121 46 25 8
2000.9 120 45 26 9
2001 120 44 26 10
2001.1 119 43 27 11
2001.2 118 44 27 11
2001.3 117 43 28 12
2001.4 115 43 30 12
2001.5 115 42 30 13
2001.6 114 42 31 13
2001.7 112 42 32 14
2001.8 111 42 33 14
2001.9 106 44 36 14
2002 105 44 37 14
2002.1 104 43 38 15
2002.2 104 43 38 15
2002.3 103 43 39 15
2002.4 101 43 41 15
2002.5 101 43 41 15
2002.6 101 43 41 15
2002.7 101 43 41 15
2002.8 101 42 41 16
2002.9 100 43 41 16
2003 100 43 41 16
2003.1 100 43 41 16
2003.2 100 43 41 16
2003.3 99 43 42 16
2003.4 98 44 42 16
2003.5 97 44 43 16
2003.6 97 44 43 16
2003.7 96 45 43 16
2003.8 95 45 44 16
2003.9 95 45 44 16
2004 94 45 45 16
2004.1 92 45 47 16
2004.2 88 46 50 16
2004.3 88 46 50 16
2004.4 87 46 51 16
2004.5 87 46 51 16
2004.6 86 46 52 16
2004.7 85 46 53 16
2004.8 85 45 53 17
2004.9 85 45 53 17
2005 84 45 54 17
>
> # Show the cumulative prevalences in a different order than that of the
> # state-level ordering and plot them using all defaults
> pp <- pState( nSt, perm=c(1,2,4,3) )
> head( pp )
State
when DM Ins Dead(Ins) Dead
1995 1.000 1 1 1
1995.1 1.000 1 1 1
1995.2 1.000 1 1 1
1995.3 1.000 1 1 1
1995.4 1.000 1 1 1
1995.5 0.995 1 1 1
> plot( pp )
>
> # A more useful set-up of the graph
> clr <- c("orange2","forestgreen")
> par( las=1 )
> plot( pp, col=clr[c(2,1,1,2)] )
> lines( as.numeric(rownames(pp)), pp[,2], lwd=2 )
> mtext( "60 year old male, diagnosed 1995", side=3, line=2.5, adj=0 )
> mtext( "Survival curve", side=3, line=1.5, adj=0 )
> mtext( "DM, no insulin DM, Insulin", side=3, line=0.5, adj=0, col=clr[1] )
> mtext( "DM, no insulin", side=3, line=0.5, adj=0, col=clr[2] )
> axis( side=4 )
>
> # Using a Cox-model for the mortality rates assuming the two mortality
> # rates to be proportional:
> # When we fit a Cox-model, lex.dur must be used in the Surv() function,
> # and the I() constrction must be used when specifying intermediate
> # states as covariates, since factors with levels not present in the
> # data will create NAs in the parameter vector returned by coxph, which
> # in return will crash the simulation machinery.
> library( survival )
> Cox.Dead <- coxph( Surv( DMdur, DMdur+lex.dur,
+ lex.Xst %in% c("Dead(Ins)","Dead")) ~
+ Ns( Age-DMdur, knots=ad.kn ) +
+ I(lex.Cst=="Ins") +
+ I(Per-2000) + sex,
+ data = Si )
> Cr <- list( "DM" = list( "Ins" = DM.Ins,
+ "Dead" = Cox.Dead ),
+ "Ins" = list( "Dead(Ins)" = Cox.Dead ) )
> simL <- simLexis( Cr, ini, time.pts=seq(0,11,0.2), N=200 )
Error in a$specials[[i]] : subscript out of bounds
Calls: simLexis ... model.matrix -> model.matrix.coxph -> delete.response -> off
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 2.66
Check: re-building of vignette outputs
Result: ERROR
Error(s) in re-building vignettes:
...
--- re-building ‘n01-flup.rnw’ using Sweave
Attaching package: ‘survival’
The following object is masked from ‘package:popEpi’:
Surv
Error: processing vignette 'n01-flup.rnw' failed with diagnostics:
chunk 39 (label = Ieff)
Error in a$specials[[i]] : subscript out of bounds
--- failed re-building ‘n01-flup.rnw’
--- re-building ‘n02-addLexis.rnw’ using Sweave
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
Joining with `by = join_by(lex.id)`
Joining with `by = join_by(lex.id)`
Joining with `by = join_by(lex.id)`
--- finished re-building ‘n02-addLexis.rnw’
--- re-building ‘n03-crisk.rnw’ using Sweave
Attaching package: ‘survival’
The following object is masked from ‘package:popEpi’:
Surv
--- finished re-building ‘n03-crisk.rnw’
--- re-building ‘n04-simLexis.rnw’ using Sweave
Attaching package: ‘survival’
The following object is masked from ‘package:popEpi’:
Surv
Timing stopped at: 0.327 0 0.332
Error: processing vignette 'n04-simLexis.rnw' failed with diagnostics:
chunk 26 (label = TR.c)
Error in a$specials[[i]] : subscript out of bounds
--- failed re-building ‘n04-simLexis.rnw’
--- re-building ‘n05-yll.rnw’ using Sweave
Attaching package: ‘survival’
The following object is masked from ‘package:popEpi’:
Surv
--- finished re-building ‘n05-yll.rnw’
SUMMARY: processing the following files failed:
‘n01-flup.rnw’ ‘n04-simLexis.rnw’
Error: Vignette re-building failed.
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc