to_mv: Returns the passed items as multivariate data

View source: R/to_mv.R

to_mvR Documentation

Returns the passed items as multivariate data

Description

This function will provide the alleles within a locus object for either a single locus or for a vector of loci

Usage

to_mv(x, ploidy, alleles, drop.allele = FALSE, leave.as.na = FALSE, ...)

## Default S3 method:
to_mv(x, ...)

## S3 method for class 'locus'
to_mv(
  x,
  ploidy = 2,
  alleles = NA,
  drop.allele = FALSE,
  leave.as.na = FALSE,
  ...
)

## S3 method for class 'data.frame'
to_mv(
  x,
  ploidy = 2,
  alleles = NA,
  drop.allele = FALSE,
  leave.as.na = FALSE,
  ...
)

Arguments

x

A object to convert.

ploidy

The number of alleles at an individuals locus (default=2)

alleles

A set of alleles to make the matrix columns on.

drop.allele

A flag indicating an allele should be dropped.

leave.as.na

A flag to re-insert NA values into multivariate data where missing genotypes were encountered (Default=FALSE) if not, zeros are used.

...

Ignored

Value

The matrix representation of x.

Numerical value of x

Matrix representing the locus

A matrix

Author(s)

Rodney J. Dyer rjdyer@vcu.edu


dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.