importData: Import Data to create a 'TrtDataObj' object.

Description Usage Arguments Details Value See Also

View source: R/2-1-import.R

Description

A user-friendly function to create a TrtDataObj object.

Usage

1
2
3
importData(X, trtResp = NULL, trtLabl = NULL, trtLevl = levels(trtLabl),
  trtTrue = NULL, sample.weight = rep(1, dim(X)[1]),
  sample.inclsn = rep(TRUE, dim(X)[1]))

Arguments

X

A matrix or data.frame containing all samples/variables. It has to be numeric and cannot be left blank. Any variable with missing value will be removed.

trtResp

A numeric vector, indicating the response under assigned treatment. If it's left blank, t his object could not be used to build models but could be used in predict function.

trtLabl

A factor vector, the sample treatment labels.

trtLevl

A character vector of length two, the unique treatment labels. The default is levels(trtLabl).

trtTrue

A factor vector, true optimal treatment labels. Left missing if not provided.

sample.weight

A numeric vector, sample weight used to evaluate the performance.

sample.inclsn

A logical vector, indicating whether a sample is used to evaluate the performance.

Details

This function takes data set and generate an TrtDataObj in a flexible way:

X can be either a matrix of a data.frame, of which each column is a numeric predictor of the data set and each row is all predictor values for a sample. X should contain all samples/variables.

Value

An TrtDataObj object.

See Also

TrtDataObj-class


SkadiEye/ITRlearn documentation built on May 24, 2019, 1:31 a.m.