Package 'verbalisr'

Title: Describe Pedigree Relationships in Words
Description: Describe in words the genealogical relationship between two members of a given pedigree, using the algorithm in Vigeland (2022) <doi:10.1186/s12859-022-04759-y>. 'verbalisr' is part of the 'pedsuite' collection of packages for pedigree analysis. For a demonstration of 'verbalisr', see the online app 'QuickPed' at <https://magnusdv.shinyapps.io/quickped>.
Authors: Magnus Dehli Vigeland [aut, cre]
Maintainer: Magnus Dehli Vigeland <[email protected]>
License: GPL-3
Version: 0.7.1
Built: 2024-10-04 06:18:22 UTC
Source: CRAN

Help Index


Habsburg pedigree.

Description

A subset of the royal Habsburg family, showing the ancestry of (the infamously inbred) King Charles II of Spain.

Usage

habsburg

Format

A ped object containing a pedigree with 29 members.

Source

Adapted from https://en.wikipedia.org/wiki/Habsburg_family_tree

Examples

plot(habsburg, hatched = "Charles II", cex = 0.7)

verbalise(habsburg, ids = parents(habsburg, "Charles II"))

Format and print relationship descriptions

Description

This documents the options for formatting and printing the output of verbalise().

Usage

## S3 method for class 'pairrel'
print(x, ...)

## S3 method for class 'pairrel'
format(
  x,
  cap = TRUE,
  simplify = FALSE,
  abbreviate = FALSE,
  collapse = NULL,
  includePaths = !simplify,
  ...
)

Arguments

x

An output of verbalise().

...

Arguments passed on to format.pairrel().

cap

A logical indicating if the first letter of each path description should be capitalised. By default TRUE.

simplify

A logical. If TRUE, the descriptions of lineal and avuncular relationships are simplified. Default: FALSE.

abbreviate

A logical. It TRUE, various abbreviations are applied to the descriptions, e.g. 'great-great-' -> 'gg-' and 'once removed' -> '1r'. Default: FALSE.

collapse

A single string, or NULL. If given, and the relationship has multiple descriptions, these are concatenated with paste(..., collapse = collapse).

includePaths

A logical indicating if the complete paths should be included in the output. By default TRUE.


Describe a pairwise relationship

Description

The description includes all pedigree paths between the two individuals, indicating with brackets the topmost common ancestors in each path. See print.pairrel() for formatting options when printing the results.

Usage

verbalise(x, ids = leaves(x))

Arguments

x

A ped object, or a list of such.

ids

A vector containing the names of two pedigree members.

Value

An object of class pairrel. This is essentially a list of lists, containing many details about each path between the individuals. Most users will not interact with this list directly, but simply use the description provided by the print() method.

See Also

print.pairrel().

Examples

# Example 1: Family quartet

x = nuclearPed(2)
verbalise(x, 1:2)
verbalise(x, 2:3)
verbalise(x, 3:4)

# Simplified output
verbalise(x, 2:3) |> print(simplify = TRUE)

# Example 2: Complicated cousin pedigree

y = doubleCousins(degree1 = 1, removal1 = 1, half1 = TRUE,
                  degree2 = 2, removal2 = 0, half2 = FALSE)
verbalise(y)

# Example 3: Full sib mating

z = fullSibMating(1)
verbalise(z)
verbalise(z, ids = c(1,5))
verbalise(z, ids = c(1,5)) |> print(simplify = TRUE)

# Example 4: Quad half first cousins

w = quadHalfFirstCousins()
verbalise(w)