as.data.frame.linkdat: linkdat to data.frame conversion

View source: R/as.data.frame.linkdat.R

as.data.frame.linkdatR Documentation

linkdat to data.frame conversion

Description

Convert a linkdat object to data.frame for pretty printing.

Usage

## S3 method for class 'linkdat'
as.data.frame(
  x,
  ...,
  famid = F,
  markers = seq_len(x$nMark),
  alleles = NULL,
  missing = NULL,
  singleCol = FALSE,
  sep = ""
)

Arguments

x

a linkdat object.

...

further arguments (not used).

famid

a logical indicating if the family identifier should be included as the first column.

markers

a numeric indicating which markers should be included/printed.

alleles

a character containing allele names, e.g. alleles=c('A','B').

missing

the character (of length 1) used for missing alleles. Defaults to '0'.

singleCol

a logical: Should the two alleles for each marker be pasted into one column or kept in separate columns?

sep

a single character to be used as allele separator if singleCol=TRUE.

Details

This function is mainly intended for pretty-printing linkdat objects (for instance it is called by print.linkdat). For direct manipulation of the pedigree and/or marker matrices, it is better to use as.matrix.linkdat.

Value

A data.frame.

See Also

as.matrix.linkdat

Examples


x = linkdat(toyped)
x

# Printing x as above is equivalent to:
as.data.frame(x, sep = '/', missing = '-', singleCol = TRUE)


paramlink documentation built on April 15, 2022, 9:06 a.m.