ConvertPed: Converts pedigree data frame to kinship2 pedigree object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/ConvertPed.R

Description

A data frame describing a pedigree is converted to a kinship2 pedigree object to be used by say FamiliasPosterior. Typically the input is created using paramlink.

Usage

1
ConvertPed(ped, persons = NULL)

Arguments

ped

A data frame with columns ID, FID (father id), MID (mother id),sex (1=male, 2=female), AFF (not used) possible followed by marker data, two columns for each marker

persons

A character vector indicating names of persons in the case ordered as ped[,1]. In other words, persons[1] corresponds tp ped[1,1] etc.

Value

ped

An object of class pedigree

datamatrix

A data frame. One line for each person, one column for each allele.

Author(s)

Thore Egeland <Thore.Egeland@gmail.com>

See Also

FamiliasPosterior

Examples

1
2
3
4
5
6
7
8
persons <- c("AF","mother", "daughter")
ped1=swapSex(nuclearPed(1),3)
locus1=marker(ped1,1,c(1,1),2,c(2,2),3,c(1,2))
ped1=addMarker(ped1,locus1)
# A plot function such as the following can now be used: 
# plot(ped1,marker=1,id.labels=persons,title="ped1") 
ped1=as.data.frame(ped1) 
ConvertPed(ped1,persons)

Familias documentation built on May 2, 2019, 6:33 a.m.