family {GeneticsPed} | R Documentation

## Find families (lines) in the pedigree

### 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

    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

      ## 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

[Package GeneticsPed version 1.54.0 Index]