Skip to contents

Easily add a column to cov.data part of the "haplin.data" or "haplin.ready" object

Usage

addCovar(
  data.in = stop("Data.in must be given!", call. = FALSE),
  covar = stop("covar must be given!", call. = FALSE),
  c.name = stop("c.name must be given!", call. = FALSE)
)

Arguments

data.in

The input data, "haplin.data" or "haplin.ready" object.

covar

The vector to be added.

c.name

The name of the column that will be added to cov.data.

Value

An object of the same class as data.in but with additional covariates.

Details

Add a character or integer vector to the "cov.data" part of the "haplin.data" or "haplin.ready" object. This is useful e.g., when preparing for stratification analysis (with haplinStrat). Note that all the parameters are required and that covar needs to be a vector of the length equal to the number of rows in the data.in.