plot.ped: Plot pedigree

Description Usage Arguments References See Also Examples

View source: R/Ped_Methods.R

Description

Plot pedigree

Usage

1
2
3
4
5
## S3 method for class 'ped'
plot(x, ref_year = NULL, gen_lab = FALSE,
  plot_legend = TRUE, location = "topleft", radius = 0.2,
  density = c(-1, 35, 55), angle = c(90, 65, 40), gen_stretch = 2,
  cex = 1, adj = 1, line = 2, mar = c(5.1, 4.1, 4.1, 2.1), ...)

Arguments

x

An object of class ped.

ref_year

When provided, the reference year for age labels. Users may supply a (numeric) year which will create age labels at the specified year. Alternatively, users may set ref_year = "ascYR", which will create age lables for the year the pedigree was ascertained, when ascertained. By default, ref_year = NULL and no age labels are created.

gen_lab

Logical. Should generation labels be printed in the margin. By default, FALSE.

plot_legend

Logical. Should legend for symbol shading be plotted. By default, TRUE.

location

The location for the pedigree legend, as in pedigree.legend. Options include: "topleft", "topright", "bottomright", or "bottomleft". By default, location = "topleft".

radius

The radius size for the pedigree legend, as in pedigree.legend. By default, radius = 0.2.

density

The density of shading in plotted symbols, as in plot.pedigree. By default, density = c(-1, 35, 55).

angle

The angle of shading in plotted symbols, as in plot.pedigree. By default, angle = c(90, 65, 40).

gen_stretch

Numeric. Used to stretch the spacing between generation lables. By default, gen_stretch = 2. Increase for more space between labels, decrease for less space.

cex

The text size. By default, cex = 1.

adj

When ref_year is supplied, used to adjust position of reference year, as in mtext. By default, adj = 1.

line

When ref_year is supplied, used to adjust position of reference year, as in mtext. By default, line = 2.

mar

The sizes for plot margins, as in par.

...

Extra options that feed to plot.pedigree, or plot.

References

Terry M Therneau and Jason Sinnwell (2015). kinship2: Pedigree Functions. R package version 1.6.4. https://CRAN.R-project.org/package=kinship2

See Also

plot.pedigree, pedigree.legend, plot, par

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#Read in age-specific harard data and create hazard object.
data(AgeSpecific_Hazards)
haz_obj <- hazard(hazardDF = AgeSpecific_Hazards)

#Simulate a pedigree ascertained for multiple affecteds
set.seed(2)
RVped2015 <- sim_RVped(hazard_rates = haz_obj,
                       num_affected = 2,
                       ascertain_span = c(1900, 2015),
                       GRR = 30, carrier_prob = 0.002,
                       RVfounder = TRUE,
                       stop_year = 2015,
                       recall_probs = c(1),
                       founder_byears = c(1900, 1905),
                       FamID = 1)[[2]]

summary(RVped2015)

#plot pedigree without age labels
plot(RVped2015)

#plot pedigree with age labels, set the
#reference year to be the ascertainment year
plot(RVped2015, ref_year = "ascYr")

#plot pedigree with age lablels at specified reference years.
plot(RVped2015, ref_year = 2015, cex = 0.75, symbolsize = 0.95)
plot(RVped2015, ref_year = 2005, cex= 0.75, symbolsize = 1.25)
plot(RVped2015, ref_year = 1995, cex= 0.75, symbolsize = 1.25)
plot(RVped2015, ref_year = 1985, cex= 0.75, symbolsize = 1.25)

# plot pedigree generation labels
plot(RVped2015, ref_year = 2015,
     gen_lab = TRUE,
     cex = 0.75, symbolsize = 0.95)

# use gen_stretch to place extra space between generation labels
# NOTE: by default, gen_stretch = 2; increase for extra space.
plot(RVped2015, ref_year = 2015,
     gen_lab = TRUE, gen_stretch = 3,
     cex = 0.75, symbolsize = 0.95)

simrvprojects/SimRVPedigree documentation built on Feb. 12, 2020, 6:12 p.m.