ggforest: Forest Plot of Hourly Odds

Description Usage Arguments Details Value Examples

Description

Creates an OR plot for each hour of data given. Its a ggplot format so additional variables, like titles, can be added in.

Usage

1
ggforest(ot, time = "time", or = "OR", lower = "Lower", upper = "Upper")

Arguments

ot

Odd Ratio table with the following columns.

time

Name of time variable (or "grouping" variable)

or

Name of column containing odds ratio

lower

Name of column of lower boundary of 95 percent CI

upper

Name of column of upper boundary of 95 percent CI

Details

This function creates a forest plot using the OR developed by the card::circ_odds function in this package. By default, it takes the output, which is a tibble named "ot", and will generate a forest plot based on the grouping variable (default is time of day). Original data can be restricted or the hours can be reduced).

Value

A ggplot of forest plot that can be extended. Default theme is minimal and default color scheme is viridis.

Examples

1
2
3
4
5
6
7
8
9
# Data
data(twins)
ot <- circ_odds(twins, "hour", "sad_bin", "rDYX")

# Plot
library(ggplot2)
ggforest(ot) +
  labs(title = "Example") +
  scale_color_viridis_c(option = "A")

card documentation built on Sept. 3, 2020, 9:07 a.m.