Learn R Programming

Meiosis (version 1.0.2)

restructure: Restructure genotypic data

Description

Restructure genotypic data into several forms.

This function is not yet official part of the package:

Usage

restructure(individual, struc = c("_", "g", "c", "cg"), check = FALSE)

Arguments

individual
An individual (genotypic representation).
struc
Character. Either of c('_', 'g', 'c', 'cg')
check
Logical. Should checks be performed?

Value

A matrix or a list, depending on the parameter struc.

Details

If struc == '_' (default), the result is a matrix (both chromosomes and gametes are concatenated). If struc == 'g', only gametes are concatenated (chromosomes remain separated). If struc == 'c', only chromosomes are concatenated (gametes remain separated), and if struc == 'cg', gametes get nested within chromosomes, everything being separated.

Examples

Run this code
## Not run: ------------------------------------
# data('exdat', package = 'Meiosis')
# str(restructure(exdat$ind))
# str(restructure(exdat$ind, struc = 'c'))
# str(restructure(exdat$ind, struc = 'g'))
# str(restructure(exdat$ind, struc = 'cg'))
## ---------------------------------------------

Run the code above in your browser using DataLab