plot.rds.data.frame: Diagnostic plots for the RDS recruitment process

View source: R/rds.data.frame-plots.R

plot.rds.data.frameR Documentation

Diagnostic plots for the RDS recruitment process

Description

Diagnostic plots for the RDS recruitment process

Usage

## S3 method for class 'rds.data.frame'
plot(
  x,
  plot.type = c("Recruitment tree", "Network size by wave", "Recruits by wave",
    "Recruits per seed", "Recruits per subject"),
  stratify.by = NULL,
  ...
)

Arguments

x

An rds.data.frame object.

plot.type

the type of diagnostic.

stratify.by

A factor used to color or stratify the plot elements.

...

Additional arguments for the underlying plot function if applicable.

Details

Several types of diagnostics are supported by the plot.type argument. 'Recruitment tree' displays a network plot of the RDS recruitment process. 'Network size by wave' monitors systematic changes is network size based on how far subjects are from the seed 'Recruits by wave' displays counts of subjects based on how far they rare from their seed. 'Recruit per seed' shows the total tree size for each seed. 'Recruits per subject' shows counts of how many subjects are recruited by each subject who are non-terminal.

Value

Either nothing (for the recruitment tree plot), or a ggplot2 object.

Examples

data(fauxmadrona)
## Not run: 
plot(fauxmadrona)

## End(Not run)
plot(fauxmadrona, plot.type='Recruits by wave')
plot(fauxmadrona, plot.type='Recruits per seed')
plot(fauxmadrona, plot.type='Recruits per subject')

plot(fauxmadrona, plot.type='Recruits by wave', stratify.by='disease')
plot(fauxmadrona, plot.type='Recruits per seed', stratify.by='disease')
plot(fauxmadrona, plot.type='Recruits per subject', stratify.by='disease')

RDS documentation built on Aug. 20, 2023, 9:06 a.m.