FormDataset: Forming a data set.

Description Usage Arguments Value Examples

View source: R/FormDataset.R

Description

Takes in a data frame and changes the names of the treatment and outcome columns, and drops unnecessary ones.

Usage

1
2
FormDataset(dataset, ignore.cols = NULL, out.col = NULL,
  trt.col = NULL)

Arguments

dataset

The data frame we want to reform.

ignore.cols

The indices of the columns we want to drop. Defaults to NULL. If set to NULL, no columns are dropped.

out.col

The index of the outcome column which will be renamed to 'Y'. Defaults to NULL. If set to NULL, no column will be renamed.

trt.col

The index of the treatment column which will be renamed to 'X'. Defaults to NULL. If set to NULL, no column will be renamed.

Value

A data frame with renamed the columns of treatment and outcome, and no longer includes some of the columns.

Examples

1
2
3
D <- cbind(Trt = rbinom(100, 1, 1/2), Out = rnorm(100),
           C1 = rnorm(100), C2 = rnorm(100))
D_new <- FormDataset(D, ignore.cols = 4, out.col = 2, trt.col = 1)

gpapadog/DAPSm documentation built on May 17, 2019, 8 a.m.