1
0
Fork 0
mirror of https://github.com/prise6/aVirtualTwins.git synced 2024-05-17 22:06:33 +02:00
aVirtualTwins/R/object.wrapper.R

32 lines
1,010 B
R
Raw Normal View History

2015-06-21 02:31:29 +02:00
#'
#' Initialize virtual twins data
#'
2015-07-27 01:40:52 +02:00
#' \code{vt.data} is a wrapper of \code{\link{formatRCTDataset}} and
#' \code{\link{VT.object}}. Allows to format your data.frame in order to create
#' a VT.object object.
2015-06-21 02:31:29 +02:00
#'
#' @param dataset data.frame representing RCT's
#' @param outcome.field name of the outcome's field in \code{dataset}
#' @param treatment.field name of the treatment's field in \code{dataset}
2015-07-27 01:40:52 +02:00
#' @param interactions logical. If running VirtualTwins with treatment's
2015-06-21 02:31:29 +02:00
#' interactions, set to TRUE (default value)
#' @param ... parameters of \code{\link{VT.object}}
2015-07-27 01:40:52 +02:00
#'
#' @examples
#' \dontrun{
#' data(sepsis)
#' formatRCTdataset(sepsis, "survival", "THERAPY", T)
#' }
#'
2015-06-21 02:31:29 +02:00
#' @return \code{VT.object}
2015-07-27 01:40:52 +02:00
#'
#' @include object.R
#'
2015-07-25 02:10:28 +02:00
#' @name vt.data
2015-07-27 01:40:52 +02:00
#'
2015-07-25 02:10:28 +02:00
#' @export vt.data
2015-06-21 02:31:29 +02:00
vt.data <- function(dataset, outcome.field, treatment.field, interactions = TRUE, ...){
data <- formatRCTDataset(dataset, outcome.field, treatment.field, interactions = TRUE)
VT.object(data = data, ...)
}