Skip to content

Commit 7adcc03

Browse files
committed
fix: replace if(interactive) with \donttest
1 parent 87fe9d4 commit 7adcc03

File tree

8 files changed

+17
-18
lines changed

8 files changed

+17
-18
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
^docs$
99
^pkgdown$
1010
^cran-comments\.md$
11+
^CRAN-SUBMISSION$

codemeta.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@
414414
},
415415
"SystemRequirements": null
416416
},
417-
"fileSize": "2371.954KB",
417+
"fileSize": "2372.788KB",
418418
"citation": [
419419
{
420420
"@type": "ScholarlyArticle",
@@ -448,10 +448,5 @@
448448
}
449449
}
450450
}
451-
],
452-
"releaseNotes": "https://github.com/RobinDenz1/adjustedCurves/blob/master/NEWS.md",
453-
"readme": "https://github.com/RobinDenz1/adjustedCurves/blob/main/README.md",
454-
"contIntegration": ["https://github.com/RobinDenz1/adjustedCurves/actions", "https://app.codecov.io/gh/RobinDenz1/adjustedCurves?branch=main"],
455-
"developmentStatus": "https://www.repostatus.org/#active",
456-
"keywords": ["adjusted", "survival-curves", "cumulative-incidence", "confidence-intervals"]
451+
]
457452
}

cran-comments.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
The package was tested on Windows 10, macOS and ubuntu using github actions and rhub as well as local machines.
88
There were no errors or warnings and two notes. The first note is due to this being a new release.
99
The second note only appears on some rhub checks: "checking for detritus in the temp directory Found the following files/directories: 'lastMiKTeXException'"
10+
11+
Most if(interactive()) statements have been replaced by \donttest as adviced.
12+
I only kept the if(interactive()) calls in the man pages of surv_iptw_cox, surv_iptw_km and surv_iptw_pseudo to avoid the dependency on the "optweight" package.

man/adjustedcif.Rd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ adjcif <- adjustedcif(data=sim_dat,
218218
n_boot=10)
219219

220220
# not run because those are too slow
221-
if(interactive()){
221+
\donttest{
222222
# using bootstrapping with direct adjustment, run in parallel
223223
# on two cores
224224
library(foreach)
@@ -234,7 +234,7 @@ adjcif <- adjustedcif(data=sim_dat,
234234
outcome_model=cox_mod,
235235
conf_int=TRUE,
236236
bootstrap=TRUE,
237-
n_boot=10,
237+
n_boot=4,
238238
n_cores=2)
239239

240240
# using multiple imputation
@@ -251,7 +251,7 @@ sim_dat$group <- as.factor(sim_dat$group)
251251
sim_dat$x1 <- ifelse(runif(n=50) < 0.5, sim_dat$x1, NA)
252252

253253
# perform multiple imputation
254-
mids <- mice::mice(data=sim_dat, method="pmm", m=5, printFlag=FALSE)
254+
mids <- mice::mice(data=sim_dat, method="pmm", m=2, printFlag=FALSE)
255255

256256
# IPTW Pseudo using WeightIt on imputed data, for cause = 1
257257
adj <- adjustedcif(data=mids,

man/adjustedsurv.Rd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ adjsurv <- adjustedsurv(data=sim_dat,
220220
n_boot=10)
221221

222222
# not run because those are too slow
223-
if(interactive()){
223+
\donttest{
224224
# using bootstrapping with direct adjustment, run in parallel
225225
# on two cores
226226
adjsurv <- adjustedsurv(data=sim_dat,
@@ -231,7 +231,7 @@ adjsurv <- adjustedsurv(data=sim_dat,
231231
outcome_model=cox_mod,
232232
conf_int=TRUE,
233233
bootstrap=TRUE,
234-
n_boot=10,
234+
n_boot=4,
235235
n_cores=2)
236236

237237
# using multiple imputation
@@ -248,7 +248,7 @@ sim_dat$group <- as.factor(sim_dat$group)
248248
sim_dat$x1 <- ifelse(runif(n=50) < 0.5, sim_dat$x1, NA)
249249

250250
# perform multiple imputation
251-
mids <- mice::mice(data=sim_dat, method="pmm", m=5, printFlag=FALSE)
251+
mids <- mice::mice(data=sim_dat, method="pmm", m=2, printFlag=FALSE)
252252

253253
# IPTW KM using WeightIt on imputed data
254254
adj <- adjustedsurv(data=mids,

man/cif_tmle.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ The wrapper function was written by Robin Denz, the \pkg{survtmle} package (whic
7878
}
7979
\examples{
8080
# not run because any meaningful example is too slow
81-
if(interactive()){
81+
\donttest{
8282
library(adjustedCurves)
8383
library(survtmle)
8484

8585
set.seed(42)
8686

8787
# simulate some data as example
88-
sim_dat <- sim_confounded_crisk(n=50, max_t=5)
88+
sim_dat <- sim_confounded_crisk(n=30, max_t=5)
8989
sim_dat$group <- as.factor(sim_dat$group)
9090

9191
# only works with integer time, only unbiased with small amounts of them

man/surv_ostmle.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The wrapper function was written by Robin Denz, the \code{MOSS} package (which t
8787
}
8888
\examples{
8989
# not run because any meaningful example is too slow
90-
if(interactive()){
90+
\donttest{
9191
library(adjustedCurves)
9292
9393
# simulate some data as example

man/surv_tmle.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ The wrapper function was written by Robin Denz, the \code{survtmle} package (whi
8181
}
8282
\examples{
8383
# not run because any meaningful example is too slow
84-
if(interactive()){
84+
\donttest{
8585
library(adjustedCurves)
8686
library(survtmle)
8787

8888
set.seed(42)
8989

9090
# simulate some data as example
91-
sim_dat <- sim_confounded_surv(n=50, max_t=1.2)
91+
sim_dat <- sim_confounded_surv(n=30, max_t=1.2)
9292
sim_dat$group <- as.factor(sim_dat$group)
9393

9494
# only works with integer time, only unbiased with small amounts of them

0 commit comments

Comments
 (0)