nIndividual: Number of individuals in a pedigree

Description Usage Arguments Details Author(s) See Also Examples

View source: R/nIndividual.R

Description

nIndividual returns number of individuals (individuals and/or ascendants) in a pedigree object.

Usage

1

Arguments

x

pedigree

col

character, which id column should be the source: "id" (default) or particular ascendant i.e. "father" and "mother"

extend

logical, extend pedigree

drop

logical, drop unused levels in case factors are used

Details

FIXME - this will change a lot!!!! There is always one additional level in levels in case factors are used to represent individuals in a pedigree as described in Pedigree. However, nlevels.Pedigree prints out the number of levels actually used to represent individuals i.e. level unknown is not included into the result.

Author(s)

Gregor Gorjanc

See Also

summary.Pedigree, extend

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  # Deafult example
  ped <- generatePedigree(5)
  nIndividual(ped)

  # Other id columns
  nIndividual(ped, col="father")
  nIndividual(ped, col="mother")

  # Remove individuals with unknown fathers - FIXME
  # ped <- ped[!is.na(ped, col="father"), ]
  # nIndividual(ped)
  # nIndividual(ped, extend=FALSE)

Example output

Loading required package: MASS

Attaching package:GeneticsPedThe following object is masked frompackage:stats:

    family

[1] 15
[1] 4
[1] 4

GeneticsPed documentation built on Nov. 8, 2020, 5:54 p.m.