Learn R Programming

logicDT (version 1.0.5)

splitSNPs: Split biallelic SNPs into binary variables

Description

This function takes a matrix or data frame of SNPs coded as 0, 1, 2 or 1, 2, 3 and returns a data frame with twice as many columns. SNPs are splitted into dominant and recessive modes, i.e., for a \(\mathrm{SNP} \in \lbrace 0,1,2 \rbrace\), two variables \(\mathrm{SNP}_D = (\mathrm{SNP} \neq 0)\) and \(\mathrm{SNP}_R = (\mathrm{SNP} = 2)\) are generated.

Usage

splitSNPs(data)

Value

A data frame of the splitted SNPs

Arguments

data

A matrix or data frame only consisting of SNPs to be splitted