View source: R/plot.simfam_c.R
plot.simfam_c | R Documentation |
simfam_c
or Plot pedigreesProvides pedigree plots for specified families generated from simfam_c
function with option to save plots into a pdf file.
## S3 method for class 'simfam_c' plot(x, famid, pdf = FALSE, file = NULL, ...)
x |
An object of class |
famid |
List of family IDs to plot. Default is the first family in given data set. |
pdf |
Logical; if |
file |
File name to save the pedigree plots; Default file name is |
... |
Additional arguments passed on to the plot function. |
Argument x
can be a data frame that contains famID
, indID
, fatherID
, motherID
, gender
(1 for male, 0 for female), status
(1 for affected by event 1, 2 for affected by event 2, 0 for non-affected), mgene
(1 for mutation carrier, 0 for non-carrier, NA
for missing), and proband
(1 for proband, 0 for non-proband) and should have class attributes class(x) <- c("simfam", "data.frame")
.
Optionally, the data frame can contain a column named carrp.geno
or carrp.pheno
to replace missing values in mgene
with their carrier probabilities.
Returns pedigree plots for specified families created by simfam_c
function or for the data frame provided along with the affection and carrier mutation statuses of family members. Probands from each pedigree are indicated using red color.
When object inlcudes carrp.geno
and/or carrp.pheno
generated by carrierprob
function, the plot
function displays the carrier probabilities for those with missing carrier status.
simfam, summary.simfam, carrierprob
# Simulated competing risk data from gamma frailty model based on pop+ design set.seed(4321) fam <- simfam_c(N.fam = 10, design = "pop+", variation = "frailty", competing=TRUE, base.dist = "Weibull", frailty.dist = "gamma", depend=c(2, 2), allelefreq = 0.02, base.parms = list(c(0.01, 3), c(0.01, 3)), vbeta = list(c(-1.13, 2.35),c(-1, 2))) # Pedigree plots for first three simulated families plot(fam, famid = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.