mirror of
https://github.com/prise6/aVirtualTwins.git
synced 2024-05-09 20:46:33 +02:00
Update export/depends/suggests
This commit is contained in:
parent
6a4dead9a9
commit
05a97ff613
23
DESCRIPTION
23
DESCRIPTION
|
@ -1,18 +1,22 @@
|
||||||
Package: VirtualTwins
|
Package: VirtualTwins
|
||||||
Type: Package
|
Type: Package
|
||||||
Title: What the package does (short line)
|
Title: Adaptation of Virtual Twins method from Jared Foster.
|
||||||
Version: 1.0
|
Version: 0.0.0.1000
|
||||||
Date: 2015-05-31
|
Date: 2015-05-31
|
||||||
Author: Who wrote it
|
Author: François Vieille
|
||||||
Maintainer: Who to complain to <yourfault@somewhere.net>
|
Maintainer: <vieille.francois@gmail.com>
|
||||||
Description: More about what it does (maybe more than one line)
|
Description: Research of subgroups in random clinical trials with binary
|
||||||
License: What license is it under?
|
outcome and two treatments groups.
|
||||||
|
License: MIT
|
||||||
Imports:
|
Imports:
|
||||||
rpart
|
rpart,
|
||||||
|
party
|
||||||
Suggests:
|
Suggests:
|
||||||
randomForest,
|
randomForest,
|
||||||
caret,
|
caret
|
||||||
party
|
Depends:
|
||||||
|
R (>= 3.2.0),
|
||||||
|
methods
|
||||||
Collate:
|
Collate:
|
||||||
'VirtualTwins.R'
|
'VirtualTwins.R'
|
||||||
'object.R'
|
'object.R'
|
||||||
|
@ -23,6 +27,7 @@ Collate:
|
||||||
'forest.double.R'
|
'forest.double.R'
|
||||||
'forest.fold.R'
|
'forest.fold.R'
|
||||||
'forest.one.R'
|
'forest.one.R'
|
||||||
|
'formatRCTDataset.R'
|
||||||
'incidences.R'
|
'incidences.R'
|
||||||
'tools.R'
|
'tools.R'
|
||||||
'tree.R'
|
'tree.R'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# Generated by roxygen2 (4.1.1): do not edit by hand
|
# Generated by roxygen2 (4.1.1): do not edit by hand
|
||||||
|
|
||||||
|
export(formatRCTDataset)
|
||||||
import(methods)
|
import(methods)
|
||||||
importClassesFrom(party,RandomForest)
|
importClassesFrom(party,RandomForest)
|
||||||
|
|
13
R/predict.R
13
R/predict.R
|
@ -17,6 +17,7 @@
|
||||||
#'
|
#'
|
||||||
#' @include setClass.R
|
#' @include setClass.R
|
||||||
#' @importClassesFrom party RandomForest
|
#' @importClassesFrom party RandomForest
|
||||||
|
#'
|
||||||
setGeneric("VT.predict",
|
setGeneric("VT.predict",
|
||||||
function(rfor, newdata, type){standardGeneric("VT.predict")}
|
function(rfor, newdata, type){standardGeneric("VT.predict")}
|
||||||
)
|
)
|
||||||
|
@ -29,7 +30,7 @@ setMethod(
|
||||||
if(! type %in% c("binary", "continous")) stop("Type must be Binary or continous")
|
if(! type %in% c("binary", "continous")) stop("Type must be Binary or continous")
|
||||||
if(type == "binary"){
|
if(type == "binary"){
|
||||||
if(!requireNamespace("party", quietly = TRUE)) stop("Party package must be loaded.")
|
if(!requireNamespace("party", quietly = TRUE)) stop("Party package must be loaded.")
|
||||||
tmp <- predict.RandomForest(rfor, OOB = T, type = "prob")
|
tmp <- party:::predict.RandomForest(rfor, OOB = T, type = "prob")
|
||||||
tmp <- unlist(tmp)
|
tmp <- unlist(tmp)
|
||||||
tmp <- tmp[seq(2, length(tmp), 2)]
|
tmp <- tmp[seq(2, length(tmp), 2)]
|
||||||
}else{
|
}else{
|
||||||
|
@ -49,7 +50,7 @@ setMethod(
|
||||||
if(! type %in% c("binary", "continous")) stop("Type must be Binary or continous")
|
if(! type %in% c("binary", "continous")) stop("Type must be Binary or continous")
|
||||||
if(type == "binary"){
|
if(type == "binary"){
|
||||||
if(!requireNamespace("party", quietly = TRUE)) stop("Party package must be loaded.")
|
if(!requireNamespace("party", quietly = TRUE)) stop("Party package must be loaded.")
|
||||||
tmp <- predict.RandomForest(rfor, newdata = newdata, type = "prob")
|
tmp <- party:::predict.RandomForest(rfor, newdata = newdata, type = "prob")
|
||||||
tmp <- unlist(tmp)
|
tmp <- unlist(tmp)
|
||||||
tmp <- tmp[seq(2, length(tmp), 2)]
|
tmp <- tmp[seq(2, length(tmp), 2)]
|
||||||
}else{
|
}else{
|
||||||
|
@ -71,7 +72,7 @@ setMethod(
|
||||||
# no longer available in all version ?!
|
# no longer available in all version ?!
|
||||||
# tmp <- rfor$vote[, 2] # get the "o" prob
|
# tmp <- rfor$vote[, 2] # get the "o" prob
|
||||||
if(!requireNamespace("randomForest", quietly = TRUE)) stop("randomForest package must be loaded.")
|
if(!requireNamespace("randomForest", quietly = TRUE)) stop("randomForest package must be loaded.")
|
||||||
tmp <- predict.randomForest(rfor, type = "prob")[, 2] # We want to get the "o" prob
|
tmp <- randomForest:::predict.randomForest(rfor, type = "prob")[, 2] # We want to get the "o" prob
|
||||||
}else{
|
}else{
|
||||||
message("continous is not done yet")
|
message("continous is not done yet")
|
||||||
tmp <- NULL
|
tmp <- NULL
|
||||||
|
@ -88,7 +89,7 @@ setMethod(
|
||||||
if(! type %in% c("binary", "continous")) stop("Type must be Binary or continous")
|
if(! type %in% c("binary", "continous")) stop("Type must be Binary or continous")
|
||||||
if(type == "binary"){
|
if(type == "binary"){
|
||||||
if(!requireNamespace("randomForest", quietly = TRUE)) stop("randomForest package must be loaded.")
|
if(!requireNamespace("randomForest", quietly = TRUE)) stop("randomForest package must be loaded.")
|
||||||
tmp <- predict.randomForest(rfor, newdata = newdata, type = "prob")[, 2] # We want to get the "o" prob
|
tmp <- randomForest:::predict.randomForest(rfor, newdata = newdata, type = "prob")[, 2] # We want to get the "o" prob
|
||||||
}else{
|
}else{
|
||||||
message("continous is not done yet")
|
message("continous is not done yet")
|
||||||
tmp <- NULL
|
tmp <- NULL
|
||||||
|
@ -102,7 +103,7 @@ setMethod(
|
||||||
f = "VT.predict",
|
f = "VT.predict",
|
||||||
signature = c(rfor = "train", newdata = "ANY", type = "character"),
|
signature = c(rfor = "train", newdata = "ANY", type = "character"),
|
||||||
function(rfor, newdata, type = "binary"){
|
function(rfor, newdata, type = "binary"){
|
||||||
if(!requireNamespace("caret", quietly = TRUE)) stop("randomForest package must be loaded.")
|
if(!requireNamespace("caret", quietly = TRUE)) stop("caret package must be loaded.")
|
||||||
return(VT.predict(rfor$finalModel, newdata, type))
|
return(VT.predict(rfor$finalModel, newdata, type))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -112,7 +113,7 @@ setMethod(
|
||||||
f = "VT.predict",
|
f = "VT.predict",
|
||||||
signature = c(rfor = "train", newdata = "missing", type = "character"),
|
signature = c(rfor = "train", newdata = "missing", type = "character"),
|
||||||
function(rfor, type = "binary"){
|
function(rfor, type = "binary"){
|
||||||
if(!requireNamespace("caret", quietly = TRUE)) stop("randomForest package must be loaded.")
|
if(!requireNamespace("caret", quietly = TRUE)) stop("caret package must be loaded.")
|
||||||
return(VT.predict(rfor=rfor$finalModel, type=type))
|
return(VT.predict(rfor=rfor$finalModel, type=type))
|
||||||
}
|
}
|
||||||
)
|
)
|
Loading…
Reference in a new issue