Browse Source

cran comments

tags/v1.0.0
François Vieille 2 years ago
parent
commit
265ab95466
3 changed files with 47 additions and 21 deletions
  1. 26
    0
      cran-comments.md
  2. 1
    1
      data-raw/sepsis.R
  3. 20
    20
      vignettes/full-example.Rmd

+ 26
- 0
cran-comments.md View File

@@ -0,0 +1,26 @@
1
+This is the first submission
2
+
3
+----------------------------------------------------------------
4
+
5
+## Test environments
6
+
7
+* Linux, Debian jessie, R 3.2.5
8
+* win-builder (devel and release)
9
+
10
+
11
+## R CMD check result
12
+
13
+There were no ERRORs or WARNINGs.
14
+
15
+Only one NOTE:
16
+
17
+[french]
18
+* VT.difft: possible error in new(structure("VT.difft", package = "aVirtualTwins"), ...): ... utilisé dans une situation où il n'existe pas
19
+
20
+[english]
21
+* VT.difft: possible error in new(structure("VT.difft", package = "aVirtualTwins"), ...): ... used in a situation where it does not exist
22
+
23
+It seems to be a temporary bug in R-devel [ref](http://r.789695.n4.nabble.com/R-CMD-check-quot-quot-used-in-a-situation-where-it-does-not-exist-td4701779.html)
24
+
25
+This NOTE doesn't exist in stable version of R. No NOTEs for win-builder tests.
26
+

+ 1
- 1
data-raw/sepsis.R View File

@@ -6,7 +6,7 @@ library(aVirtualTwins)
6 6
 library(randomForest) 
7 7
 
8 8
 # Sepsis is a csv file available in SIDES example to this address: 
9
-# http://biopharmnet.com/wiki/Software_for_subgroup_identification_and_analysis
9
+# http://biopharmnet.com/subgroup-analysis-software/
10 10
 # type ?sepsis to see details
11 11
 # I downloaded zip file and extract the sepsis.csv in data-raw folder. 
12 12
 sepsis.csv <- read.csv(file = "data-raw/sepsis.csv", na.strings = ".")

+ 20
- 20
vignettes/full-example.Rmd View File

@@ -93,7 +93,7 @@ Related function in aVirtualTwins package : `vt.tree()`.
93 93
 See __Introduction__.
94 94
 
95 95
 *Sepsis* dataset is a simulated clinical trial with two groups treatment about sepsis desease. See details. 
96
-This dataset is taken from [SIDES method](http://biopharmnet.com/wiki/Software_for_subgroup_identification_and_analysis)
96
+This dataset is taken from [SIDES method](http://biopharmnet.com/subgroup-analysis-software/)
97 97
 
98 98
 *Sepsis* contains simulated data on 470 subjects with a binary outcome survival, that stores survival status for patient after 28 days of treatment, value of 1 for subjects who died after 28 days and 0 otherwise. There are 11 covariates, listed below, all of which are numerical variables.
99 99
  
@@ -117,7 +117,7 @@ True subgroup is `PRAPACHE <= 26 & AGE <= 49.80`. __NOTE:__ This subgroup is def
117 117
 * `BLADL` : Baseline activity of daily living score
118 118
 * `BLLBILI` : Baseline local bilirubin
119 119
 
120
-__Source:__  http://biopharmnet.com/wiki/Software_for_subgroup_identification_and_analysis
120
+__Source:__  http://biopharmnet.com/subgroup-analysis-software/
121 121
 
122 122
 
123 123
 -----------
@@ -131,7 +131,7 @@ type `?vt.data` for more details.
131 131
 __NOTE:__ if running VT with interactions between $T$ and $X$, set `interactions = TRUE`.
132 132
 
133 133
 Code of `vt.data()` : 
134
-```{r, eval = F}
134
+```{r, collapse=T, eval = F}
135 135
 vt.data <- function(dataset, outcome.field, treatment.field, interactions = TRUE, ...){
136 136
   data <- formatRCTDataset(dataset, outcome.field, treatment.field, interactions = TRUE)
137 137
   VT.object(data = data, ...)
@@ -139,7 +139,7 @@ vt.data <- function(dataset, outcome.field, treatment.field, interactions = TRUE
139 139
 ```
140 140
 
141 141
 __Example with Sepsis__
142
-```{r}
142
+```{r, collapse=T}
143 143
 # load library VT
144 144
 library(aVirtualTwins)
145 145
 # load data sepsis
@@ -152,7 +152,7 @@ vt.o <- vt.data(sepsis, "survival", "THERAPY", TRUE)
152 152
 __Quick example__
153 153
 
154 154
 *Sepsis* does not have any categorical variable, following example show how `vt.data` deals with categorical values depending on `interactions` parameter
155
-```{r}
155
+```{r, collapse=T}
156 156
 # Creation of categorical variable
157 157
 cat.x <- rep(1:5, (nrow(sepsis))/5)
158 158
 cat.x <- as.factor(cat.x)
@@ -162,7 +162,7 @@ vt.o.tmp <- vt.data(sepsis.tmp, "survival", "THERAPY", TRUE)
162 162
 
163 163
 Dummies variables are created for each category of `cat.x` variable. And `cat.x` is removed from dataset. 
164 164
 
165
-```{r, echo = FALSE}
165
+```{r, collapse=T, echo = FALSE}
166 166
 rm(vt.o.tmp, cat.x, sepsis.tmp)
167 167
 ```
168 168
 
@@ -189,7 +189,7 @@ Class `vt.forest("one", ...)` is used. It takes in arguments :
189 189
 * `...` : options to `randomForest()` function
190 190
 
191 191
 __with `randomForest`__
192
-```{r}
192
+```{r, collapse=T}
193 193
 # use randomForest::randomForest()
194 194
 library(randomForest, verbose = F)
195 195
 # Reproducibility
@@ -210,7 +210,7 @@ __with `party`__
210 210
 
211 211
 `cforest()` can be usefull however computing time is really long. I think there is an issue when giving *cforest object* in Reference Class parameter. Need to fix it.
212 212
 
213
-```{r}
213
+```{r, collapse=T}
214 214
 # # use randomForest::randomForest()
215 215
 # library(party, verbose = F)
216 216
 # # Reproducibility
@@ -229,7 +229,7 @@ Using `caret` can be usefull to deal with parallel computing for example.
229 229
 
230 230
 __NOTE:__ For `caret` levels of outcome can't be 0, so i'll change levels name into "n"/"y"
231 231
 
232
-```{r}
232
+```{r, collapse=T}
233 233
 # Copy new object
234 234
 vt.o.tr <- vt.o$copy()
235 235
 # Change levels
@@ -269,7 +269,7 @@ Function `vt.forest("double", ...)` is used. It takes in arguments :
269 269
 __NOTE:__ use `trt` parameter in `VT.object::getX()` or `VT.object::getY()` methods to obtain part of data depending on treatment. See following example.
270 270
 
271 271
 __with `randomForest`__
272
-```{r}
272
+```{r, collapse=T}
273 273
 # grow RF for T = 1
274 274
 model.rf.trt1 <- randomForest(x = vt.o$getX(trt = 1),
275 275
                               y = vt.o$getY(trt = 1))
@@ -306,7 +306,7 @@ To use this approach, use `vt.forest("fold", ...)`. This class takes in argument
306 306
 
307 307
 __NOTE:__ This function use only `randomForest` package.
308 308
 
309
-```{r, cache=F}
309
+```{r, collapse=T, cache=F}
310 310
 
311 311
 # initialize k-fold RF
312 312
 # you can use randomForest options
@@ -325,7 +325,7 @@ Anyway, aVirtualTwins package can be used. To do so, you can use `VT.difft()` cl
325 325
 * `twin2` : estimate of $P(Y_{i} = 1 | T = 1-T_{i})$ : meaning response probability under the other treatment.
326 326
 * `method` : _absolute_ (default), _relative_ or _logit_. See `?VT.difft` for details.
327 327
 
328
-```{r}
328
+```{r, collapse=T}
329 329
 # you get twin1 and twin2 by your own method
330 330
 # here, i'll use random number between 0 and 1 :
331 331
 twin1_random <- runif(470)
@@ -367,7 +367,7 @@ To compute a classifiction tree, `vt.tree("class", ...)` is used. Internally, `r
367 367
 
368 368
 See `?VT.tree` for details.
369 369
 
370
-```{r}
370
+```{r, collapse=T}
371 371
 # initialize classification tree
372 372
 tr.class <- vt.tree("class",
373 373
                     vt.difft = vt.f.rf,
@@ -389,7 +389,7 @@ Use regression tree to explain $Z$ by covariables $X$. Then some leafs have pred
389 389
 
390 390
 The function to use is `vt.tree("reg", ...)`. It takes same parameters than classification mehod.
391 391
 
392
-```{r}
392
+```{r, collapse=T}
393 393
 # initialize regression tree
394 394
 tr.reg <- vt.tree("reg",
395 395
                   vt.difft = vt.f.rf,
@@ -418,7 +418,7 @@ This function takes in argument :
418 418
 
419 419
 If `vt.tree` is a list, unique subgroups are printed.
420 420
 
421
-```{r}
421
+```{r, collapse=T}
422 422
 # use tr.class computed previously
423 423
 vt.sbgrps <- vt.subgroups(tr.class)
424 424
 # print tables with knitr package
@@ -428,20 +428,20 @@ knitr::kable(vt.sbgrps)
428 428
 
429 429
 You can plot one tree with package `rpart.plot`
430 430
 
431
-```{r, echo=F, fig.align='center', fig.height=4, fig.width=6}
431
+```{r, collapse=T, echo=F, fig.align='center', fig.height=4, fig.width=6}
432 432
 library(rpart.plot)
433 433
 rpart.plot(tr.class$tree2$tree, type = 1, extra = 1)
434 434
 ```
435 435
 
436 436
 If you want to see competitors split : 
437 437
 
438
-```{r}
438
+```{r, collapse=T}
439 439
 tr.class$tree2$createCompetitors()
440 440
 head(tr.class$tree2$competitors)
441 441
 ```
442 442
 
443 443
 If you want to print incidence of a subgroup :
444
-```{r}
444
+```{r, collapse=T}
445 445
 vt.o$getIncidences("PRAPACHE >= 26 & AGE >= 52")
446 446
 # or
447 447
 # tr.class$tree2$getIncidences("PRAPACHE >= 26 & AGE >= 52")
@@ -449,7 +449,7 @@ vt.o$getIncidences("PRAPACHE >= 26 & AGE >= 52")
449 449
 
450 450
 If you want to get infos about the tree
451 451
 
452
-```{r}
452
+```{r, collapse=T}
453 453
 tr.class$tree2$getInfos()
454 454
 # access Ahat
455 455
 # tr.class$tree2$Ahat
@@ -457,7 +457,7 @@ tr.class$tree2$getInfos()
457 457
 
458 458
 You can re-run rpart computation:  
459 459
 
460
-```{r}
460
+```{r, collapse=T}
461 461
 tr.class$tree2$run(maxdepth = 2)
462 462
 ```
463 463
 

Loading…
Cancel
Save