family: Find families (lines) in the pedigree

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/family.R

Description

family classifies individuals in the pedigree to distinct families or lines. Two individuals are members of one family if they have at least one common ascendant. family<- provides mean to properly add family information into the pedigree.

Usage

1
2
family(x)
family(x, col=NULL) <- value

Arguments

x

pedigree object

col

character, column name in x for family

value

family values for individuals in the pedigree

Details

col provides a mean to name or possibly also rename family column with user specified value, say "familia" in Spanish. When col=NULL, which is default, "family" is used.

Value

A vector of family values (integers)

Author(s)

Gregor Gorjanc

See Also

Pedigree

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  ## Two families examples
  ped <- data.frame(    id=c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11),
                    father=c(0, 0, 0, 0, 0, 0, 5, 1, 3,  8,  7),
                    mother=c(0, 0, 0, 0, 0, 0, 6, 2, 4,  9, 10),
                generation=c(1, 1, 1, 1, 1, 1, 2, 2, 2,  3,  4))
  ped <- Pedigree(ped, unknown=0, generation="generation")
  family(ped)

  ## After break we get two families
  ped1 <- removeIndividual(ped, individual=11)
  family(ped1)

  ## Subsetting can also be used
  family(ped[1:10,])
  family(ped[7:10,])

  ## Pedigree need not be sorted in advance
  ped2 <- ped[sample(1:10), ]
  family(ped2)

  ## Assign family values to pedigree
  family(ped) <- family(ped)
  ped
  family(ped, col="familia") <- family(ped)
  ped

GeneticsPed documentation built on Nov. 17, 2017, 1:13 p.m.