1
0
Fork 0
mirror of https://github.com/prise6/aVirtualTwins.git synced 2024-05-05 20:23:10 +02:00

Added description and export

This commit is contained in:
prise6 2015-06-11 13:34:55 +02:00
parent abfded6c96
commit d51852e7f2
13 changed files with 87 additions and 54 deletions

View file

@ -3,7 +3,7 @@ Type: Package
Title: Adaptation of Virtual Twins method from Jared Foster. Title: Adaptation of Virtual Twins method from Jared Foster.
Version: 0.0.0.1000 Version: 0.0.0.1000
Date: 2015-05-31 Date: 2015-05-31
Author: François Vieille Author: Francois Vieille
Maintainer: <vieille.francois@gmail.com> Maintainer: <vieille.francois@gmail.com>
Description: Research of subgroups in random clinical trials with binary Description: Research of subgroups in random clinical trials with binary
outcome and two treatments groups. outcome and two treatments groups.

View file

@ -1,5 +1,11 @@
# Generated by roxygen2 (4.1.1): do not edit by hand # Generated by roxygen2 (4.1.1): do not edit by hand
export(VT.difft)
export(VT.forest.double)
export(VT.forest.one)
export(VT.object)
export(VT.tree.class)
export(VT.tree.reg)
export(formatRCTDataset) export(formatRCTDataset)
import(methods) import(methods)
importClassesFrom(party,RandomForest) importClassesFrom(party,RandomForest)

View file

@ -0,0 +1,24 @@
#' VirtualTwins : An adapation of VirtualTwins method created by Jared Foster.
#'
#' VirtualTwins is written mainly with reference classes. Briefly, there is three kinds of class :
#' \itemize{
#' \item \code{\link{VT.object}} class to represent RCT dataset used by VirtualTwins. To format correctly RCT dataset, use \code{\link{formatRCTDataset}}.
#' \item \code{\link{VT.difft}} class to compute difference between twins. Family \code{\link{VT.forest}} extends it to compute twins by random forest.
#' \item \code{\link{VT.tree}} class to find subgroups from \code{\link{difft}} by CART trees. \code{\link{VT.tree.class}} and \code{\link{VT.tree.reg}} extend it.
#' }
#'
#' @section TODO LIST:
#' \emph{last update : 11.06.2015}
#' \itemize{
#' \item More detailed documentation and vignettes
#' \item Write wrappers for classes
#' \item Write examples
#' \item ...
#' }
#'
#' @docType package
#' @name VirtualTwins
#' @aliases VirtualTwins-package
#'
NULL

View file

@ -17,6 +17,8 @@
#' #'
#' @name VT.difft #' @name VT.difft
#' #'
#' @export VT.difft
#'
#' @seealso \code{\link{VT.forest}}, \code{\link{VT.forest.one}}, \code{\link{VT.forest.double}} #' @seealso \code{\link{VT.forest}}, \code{\link{VT.forest.one}}, \code{\link{VT.forest.double}}
#' #'
#' @import methods #' @import methods

View file

@ -23,11 +23,13 @@
#' 1 #' 1
#' @field model_trt0 a caret/RandomForest/randomForest object for treatment T = #' @field model_trt0 a caret/RandomForest/randomForest object for treatment T =
#' 0 #' 0
#' @field ... field from parent class : \linkS4class{VT.forest} #' @field ... field from parent class : \code{\link{VT.forest}}
#' #'
#' @seealso \code{\link{VT.difft}}, \code{\link{VT.forest}}, #' @seealso \code{\link{VT.difft}}, \code{\link{VT.forest}},
#' \code{\link{VT.forest.one}} #' \code{\link{VT.forest.one}}
#' #'
#' @export VT.forest.double
#'
#' @name VT.forest.double #' @name VT.forest.double
#' #'
#' @import methods #' @import methods

View file

@ -22,6 +22,8 @@
#' #'
#' @name VT.forest.one #' @name VT.forest.one
#' #'
#' @export VT.forest.one
#'
#' @import methods #' @import methods
VT.forest.one <- setRefClass( VT.forest.one <- setRefClass(
Class = "VT.forest.one", Class = "VT.forest.one",

View file

@ -4,19 +4,18 @@
#' #'
#' A Reference Class to deal with RCT dataset #' A Reference Class to deal with RCT dataset
#' #'
#' Currently working with binary response only. Continous will come, one day. #' Currently working with binary response only. Continous will come, one day.
#' Two-levels treatment only as well. #' Two-levels treatment only as well.
#' #'
#' \code{data} field should be as described, however if virtual twins won't used #' \code{data} field should be as described, however if virtual twins won't used
#' interactions, there is no need to transform factors. A tool function to #' interactions, there is no need to transform factors. See
#' transform factor will come soon. #' \link{formatRCTDataset} for more details.
#' #'
#' #'
#' @field data Data.frame with format: \eqn{Y,T,X_{1}, \ldots, X_{p}}. Y must be #' @field data Data.frame with format: \eqn{Y,T,X_{1}, \ldots, X_{p}}. Y must be
#' two levels factor if type is binary. T must be numeric or integer. #' two levels factor if type is binary. T must be numeric or integer.
#' @field alpha Numeric, no need in this current version. Set to \code{1}. #' @field screening Logical, set to \code{FALSE} Set to \code{TRUE} to use
#' @field screening Logical, set to \code{FALSE} Set to \code{TRUE} to use \code{varimp} in trees #' \code{varimp} in trees computation.
#' computation.
#' @field varimp Character vector of important variables to use in trees #' @field varimp Character vector of important variables to use in trees
#' computation. #' computation.
#' @field delta Numeric representing the difference of incidence between #' @field delta Numeric representing the difference of incidence between
@ -28,6 +27,8 @@
#' #'
#' @name VT.object #' @name VT.object
#' #'
#' @export VT.object
#'
#' @examples #' @examples
#' \dontrun{ #' \dontrun{
#' # Default use : #' # Default use :
@ -49,14 +50,13 @@
#' vt.o$getIncidences() #' vt.o$getIncidences()
#' } #' }
#' #'
#' @seealso \code{\linkS4class{VT.difft}} #' @seealso \code{\link{VT.difft}}
#' #'
VT.object <- setRefClass( VT.object <- setRefClass(
Class = "VT.object", Class = "VT.object",
fields = list( fields = list(
data = "data.frame", data = "data.frame",
alpha = "numeric",
screening = "logical", screening = "logical",
varimp = "character", varimp = "character",
delta = "numeric", delta = "numeric",
@ -64,14 +64,12 @@ VT.object <- setRefClass(
), ),
methods = list( methods = list(
initialize = function(screening = F, alpha = 1, type = "binary", ...){ initialize = function(screening = F, type = "binary", ...){
.self$screening <- screening .self$screening <- screening
.self$type <- type .self$type <- type
.self$alpha <- alpha
.self$initFields(...) .self$initFields(...)
}, },

View file

@ -8,6 +8,8 @@
#' #'
#' @name VT.tree.class #' @name VT.tree.class
#' #'
#' @export VT.tree.class
#'
#' @import methods #' @import methods
VT.tree.class <- setRefClass( VT.tree.class <- setRefClass(
Class = "VT.tree.class", Class = "VT.tree.class",

View file

@ -6,6 +6,8 @@
#' #'
#' @include tree.R #' @include tree.R
#' #'
#' @export VT.tree.reg
#'
#' @name VT.tree.reg #' @name VT.tree.reg
VT.tree.reg <- setRefClass( VT.tree.reg <- setRefClass(

View file

@ -29,7 +29,7 @@ This is what \code{computeTwin2()} does.
\item{\code{model_trt0}}{a caret/RandomForest/randomForest object for treatment T = \item{\code{model_trt0}}{a caret/RandomForest/randomForest object for treatment T =
0} 0}
\item{\code{...}}{field from parent class : \linkS4class{VT.forest}} \item{\code{...}}{field from parent class : \code{\link{VT.forest}}}
}} }}
\section{Methods}{ \section{Methods}{

View file

@ -12,8 +12,8 @@ Currently working with binary response only. Continous will come, one day.
Two-levels treatment only as well. Two-levels treatment only as well.
\code{data} field should be as described, however if virtual twins won't used \code{data} field should be as described, however if virtual twins won't used
interactions, there is no need to transform factors. A tool function to interactions, there is no need to transform factors. See
transform factor will come soon. \link{formatRCTDataset} for more details.
} }
\section{Fields}{ \section{Fields}{
@ -21,10 +21,8 @@ transform factor will come soon.
\item{\code{data}}{Data.frame with format: \eqn{Y,T,X_{1}, \ldots, X_{p}}. Y must be \item{\code{data}}{Data.frame with format: \eqn{Y,T,X_{1}, \ldots, X_{p}}. Y must be
two levels factor if type is binary. T must be numeric or integer.} two levels factor if type is binary. T must be numeric or integer.}
\item{\code{alpha}}{Numeric, no need in this current version. Set to \code{1}.} \item{\code{screening}}{Logical, set to \code{FALSE} Set to \code{TRUE} to use
\code{varimp} in trees computation.}
\item{\code{screening}}{Logical, set to \code{FALSE} Set to \code{TRUE} to use \code{varimp} in trees
computation.}
\item{\code{varimp}}{Character vector of important variables to use in trees \item{\code{varimp}}{Character vector of important variables to use in trees
computation.} computation.}
@ -75,6 +73,6 @@ vt.o$getIncidences()
} }
} }
\seealso{ \seealso{
\code{\linkS4class{VT.difft}} \code{\link{VT.difft}}
} }

View file

@ -1,32 +0,0 @@
\name{VirtualTwins-package}
\alias{VirtualTwins-package}
\alias{VirtualTwins}
\docType{package}
\title{
\packageTitle{VirtualTwins}
}
\description{
\packageDescription{VirtualTwins}
}
\details{
The DESCRIPTION file:
\packageDESCRIPTION{VirtualTwins}
\packageIndices{VirtualTwins}
~~ An overview of how to use the package, including the most important functions ~~
}
\author{
\packageAuthor{VirtualTwins}
Maintainer: \packageMaintainer{VirtualTwins}
}
\references{
~~ Literature or other references for background information ~~
}
\keyword{ package }
\seealso{
~~ \code{\link[<pkg>:<pkg>-package]{<pkg>}} ~~
}
\examples{
}

29
man/VirtualTwins.Rd Normal file
View file

@ -0,0 +1,29 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/VirtualTwins.R
\docType{package}
\name{VirtualTwins}
\alias{VirtualTwins}
\alias{VirtualTwins-package}
\title{VirtualTwins : An adapation of VirtualTwins method created by Jared Foster.}
\description{
VirtualTwins is written mainly with reference classes. Briefly, there is three kinds of class :
\itemize{
\item \code{\link{VT.object}} class to represent RCT dataset used by VirtualTwins. To format correctly RCT dataset, use \code{\link{formatRCTDataset}}.
\item \code{\link{VT.difft}} class to compute difference between twins. Family \code{\link{VT.forest}} extends it to compute twins by random forest.
\item \code{\link{VT.tree}} class to find subgroups from \code{\link{difft}} by CART trees. \code{\link{VT.tree.class}} and \code{\link{VT.tree.reg}} extend it.
}
}
\details{
\encoding{UTF-8}
}
\section{TODO LIST}{
\emph{last update : 11.06.2015}
\itemize{
\item More detailed documentation and vignettes
\item Write wrappers for classes
\item Write examples
\item ...
}
}