Make example checkable + delete import rpart function

このコミットが含まれているのは:
François Vieille 2018-02-03 13:18:19 +01:00
コミット e1355147ea
12個のファイルの変更111行の追加113行の削除

ファイルの表示

@ -32,23 +32,24 @@
#' @return \code{VT.difft}
#'
#' @examples
#' \dontrun{
#' # data(sepsis)
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
#' # inside model :
#' vt.f <- vt.forest("one", vt.o)
#' # ...
#' # your model :
#' rf <- randomForest(y = vt.o$getY(),
#' x = vt.o$getX(int = T),
#' mtry = 3,
#' nodesize = 15)
#' vt.f <- vt.forest("one", vt.o, model = rf)
#' # ...
#' # Can also use ... parameters
#' vt.f <- vt.forest("one", vt.o, mtry = 3, nodesize = 15)
#' # ...
#' }
#'
#' data(sepsis)
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
#' # inside model :
#' vt.f <- vt.forest("one", vt.o)
#' # ...
#' # your model :
#' # library(randomForest)
#' # rf <- randomForest(y = vt.o$getY(),
#' # x = vt.o$getX(int = T),
#' # mtry = 3,
#' # nodesize = 15)
#' # vt.f <- vt.forest("one", vt.o, model = rf)
#' # ...
#' # Can also use ... parameters
#' vt.f <- vt.forest("one", vt.o, mtry = 3, nodesize = 15)
#' # ...
#'
#'
#' @include forest.R difft.R
#'

ファイルの表示

@ -25,8 +25,11 @@
#'
#' @examples
#' \dontrun{
#' data.format <- formatRCTDataset(data, "outcome", "treatment", TRUE)
#' }
#' data.format <- formatRCTDataset(data, "outcome", "treatment", TRUE)
#' }
#' data(sepsis)
#' data.format <- formatRCTDataset(sepsis, "survival", "THERAPY", T)
#'
#'
#'
#'

ファイルの表示

@ -13,18 +13,19 @@
#' @param ... parameters of \code{\link{VT.object}}
#'
#' @examples
#' \dontrun{
#' data(sepsis)
#' formatRCTdataset(sepsis, "survival", "THERAPY", T)
#' }
#'
#' data(sepsis)
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
#'
#' @return \code{VT.object}
#'
#' @include object.R
#' @include object.R
#'
#' @name vt.data
#'
#' @export vt.data
#'
#' @seealso \code{\link{formatRCTDataset}}
vt.data <- function(dataset, outcome.field, treatment.field, interactions = TRUE, ...){
data <- formatRCTDataset(dataset, outcome.field, treatment.field, interactions = TRUE)

ファイルの表示

@ -18,18 +18,16 @@
#' @return data.frame of rules
#'
#' @examples
#' \dontrun{
#' # data(sepsis)
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
#' # inside model :
#' vt.f <- vt.forest("one", vt.o)
#' # use classification tree
#' vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
#' # show subgroups
#' vt.subgroups(vt.tr)
#' # change options you'll be surprised !
#' vt.subgroups(vt.tr, verbose = T, tables = T)
#' }
#' data(sepsis)
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", TRUE)
#' # inside model :
#' vt.f <- vt.forest("one", vt.o)
#' # use classification tree
#' vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
#' # show subgroups
#' subgroups <- vt.subgroups(vt.tr)
#' # change options you'll be surprised !
#' subgroups <- vt.subgroups(vt.tr, verbose = TRUE, tables = TRUE)
#'
#' @export vt.subgroups
#'

ファイルの表示

@ -11,7 +11,7 @@
#' @export VT.tree.class
#'
#' @import methods
#' @importFrom rpart rpart
#'
VT.tree.class <- setRefClass(
Class = "VT.tree.class",

ファイルの表示

@ -24,21 +24,21 @@
#' dimension. See examples.
#'
#' @examples
#' \dontrun{
#' # data(sepsis)
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
#' # inside model :
#' vt.f <- vt.forest("one", vt.o)
#' # use classification tree
#' vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
#' # return a list
#' class(vt.tr)
#' # access one of the tree
#' vt.tr$tree1
#' # return infos
#' vt.tr$tree1$getInfos()
#' # ...
#' }
#' data(sepsis)
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
#' # inside model :
#' vt.f <- vt.forest("one", vt.o)
#' # use classification tree
#' vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
#' # return a list
#' class(vt.tr)
#' # access one of the tree
#' tree1 <- vt.tr$tree1
#' # return infos
#' # vt.tr$tree1$getInfos()
#' # vt.tr$tree1$getRules()
#' # use vt.subgroups tool:
#' subgroups <- vt.subgroups(vt.tr)
#'
#' @include tree.R
#'

ファイルの表示

@ -16,15 +16,6 @@ aVirtualTwins is written mainly with reference classes. Briefly, there is three
\code{\link{vt.tree}} is users function.
}
}
\section{TODO LIST}{
\emph{last update : 27.07.2015}
\itemize{
\item More detailed documentation and vignettes
\item Write examples
\item ...
\details{
See http://github.com/prise6/aVirtualTwins for last updates.
}
See github.com/prise6/aVirtualTwins for last updates.
}

ファイルの表示

@ -37,8 +37,11 @@ running VirtualTwins with interaction, it creates dummy variables.
}
\examples{
\dontrun{
data.format <- formatRCTDataset(data, "outcome", "treatment", TRUE)
}
data.format <- formatRCTDataset(data, "outcome", "treatment", TRUE)
}
data(sepsis)
data.format <- formatRCTDataset(sepsis, "survival", "THERAPY", T)

ファイルの表示

@ -27,9 +27,11 @@ interactions, set to TRUE (default value)}
a VT.object object.
}
\examples{
\dontrun{
data(sepsis)
formatRCTdataset(sepsis, "survival", "THERAPY", T)
}
data(sepsis)
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
}
\seealso{
\code{\link{formatRCTDataset}}
}

ファイルの表示

@ -50,22 +50,23 @@ Is only used with forest.type = "fold". Default to 5. See
parameter forest.type, any of these class can be used with its own parameter.
}
\examples{
\dontrun{
# data(sepsis)
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
# inside model :
vt.f <- vt.forest("one", vt.o)
# ...
# your model :
rf <- randomForest(y = vt.o$getY(),
x = vt.o$getX(int = T),
mtry = 3,
nodesize = 15)
vt.f <- vt.forest("one", vt.o, model = rf)
# ...
# Can also use ... parameters
vt.f <- vt.forest("one", vt.o, mtry = 3, nodesize = 15)
# ...
}
data(sepsis)
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
# inside model :
vt.f <- vt.forest("one", vt.o)
# ...
# your model :
# library(randomForest)
# rf <- randomForest(y = vt.o$getY(),
# x = vt.o$getX(int = T),
# mtry = 3,
# nodesize = 15)
# vt.f <- vt.forest("one", vt.o, model = rf)
# ...
# Can also use ... parameters
vt.f <- vt.forest("one", vt.o, mtry = 3, nodesize = 15)
# ...
}

ファイルの表示

@ -32,17 +32,15 @@ Function which uses \code{\link{VT.tree}} intern functions. Package
rpart.plot must be loaded. See \code{\link{VT.tree}} for details.
}
\examples{
\dontrun{
# data(sepsis)
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
# inside model :
vt.f <- vt.forest("one", vt.o)
# use classification tree
vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
# show subgroups
vt.subgroups(vt.tr)
# change options you'll be surprised !
vt.subgroups(vt.tr, verbose = T, tables = T)
}
data(sepsis)
vt.o <- vt.data(sepsis, "survival", "THERAPY", TRUE)
# inside model :
vt.f <- vt.forest("one", vt.o)
# use classification tree
vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
# show subgroups
subgroups <- vt.subgroups(vt.tr)
# change options you'll be surprised !
subgroups <- vt.subgroups(vt.tr, verbose = TRUE, tables = TRUE)
}

ファイルの表示

@ -39,20 +39,20 @@ See \code{\link{VT.tree}}, \code{\link{VT.tree.class}} and
\code{\link{VT.tree.reg}} classes.
}
\examples{
\dontrun{
# data(sepsis)
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
# inside model :
vt.f <- vt.forest("one", vt.o)
# use classification tree
vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
# return a list
class(vt.tr)
# access one of the tree
vt.tr$tree1
# return infos
vt.tr$tree1$getInfos()
# ...
}
data(sepsis)
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
# inside model :
vt.f <- vt.forest("one", vt.o)
# use classification tree
vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
# return a list
class(vt.tr)
# access one of the tree
tree1 <- vt.tr$tree1
# return infos
# vt.tr$tree1$getInfos()
# vt.tr$tree1$getRules()
# use vt.subgroups tool:
subgroups <- vt.subgroups(vt.tr)
}