pattern.simsum: pattern method for simsum objects

Description Usage Arguments Details Value Note Examples

View source: R/pattern.simsum.R

Description

pattern() method for objects of class simsum.

Usage

1
2
## S3 method for class 'simsum'
pattern(obj, gpars = list(), ...)

Arguments

obj

An object of class simsum.

gpars

Graphical parameters. Must be a named list, with possible parameters:

  • alpha, alpha value of each point on the scatterplot;

  • scales, scale of x and y axis of each facet. It is possible to redefine all the graphical parameters or a subset only; if not specified, sensible default values will be utilised. Good practice would be adding a colorblind-safe palette, e.g. using ggthemes::scale_color_colorblind().

...

Ignored.

Details

pattern() requires simsum and multisimsum objects top be fit with the x = TRUE option.

Value

A ggplot2::ggplot() object that can be combined with additional geom_*, scale_*, theme_*, etc.

Note

pattern() automatically factorises the variable representing methods if present and if not already a factor; this allows ggplot2 to appropriately pick a discrete colour scale rather than a continuous one.

Examples

1
2
3
4
5
6
library(rsimsum)
library(ggplot2)
data("relhaz", package = "rsimsum")
s <- simsum(data = relhaz, estvarname = "theta", true = -0.5, se = "se",
  methodvar = "model", by = c("n", "baseline"), x = TRUE)
pattern(s)

rsimsum documentation built on June 21, 2018, 5:04 p.m.