Learn R Programming

BayHap (version 1.0.1)

setupData: Check and prepares original data to be analyzed

Description

This function checks if the data set is suitable for the analysis (type and format) and creates a new data frame including some internal variables.

Usage

setupData(data, col.snps = NULL, snps.name = NULL, sep)

Arguments

data
A data.frame in which each row represents an individual and columns are the variables ocurring in the formula (response, SNPs information and covariates, see bayhapReg documentation for more details). All columns must be non factors. Each SNP have to be a character string holding both alleles with the separator specified by the argument sep. Data must contain one column for each SNP. No variable in the original data.frame should be called haplotypes by the user.
col.snps
A numerical vector indicating the position of each SNP in data. This is an optional parameter, instead of this the name of each SNP can be informed in snps.name.
snps.name
A vector containing the names of each SNP in the data. This is an optional parameter, instead of this the column position of each SNP can be informed in col.snps.
sep
Character separator to divide alleles.

Value

A data.frame ready to be inserted in bayhapReg.

Details

This function must be executed before running bayhapReg. The resulting data.frame must be the object to pass to bayhapReg as a data parameter. Original data must not contain any variable named haplotypes because this is an specific word for this package.

See Also

bayhapReg