geom_pointline_sem: ggplot group summary stat with line, point and error bar

View source: R/geom_pointline_sem.R

geom_pointline_semR Documentation

ggplot group summary stat with line, point and error bar

Description

ggplot group summary stat with line, point and error bar

Usage

geom_pointline_sem(
  point = T,
  point_fill = "red",
  line = T,
  line_color = "red",
  linewidth = 1,
  error = T,
  errorbarwidth = 0.2,
  pd = 0
)

Arguments

point

add points (TRUE/FALSE)

point_fill

fill color for points (default = "red")

line

add connecting lines (TRUE/FALSE)

line_color

line color (default = "red")

linewidth

width for line and errorbar line

error

add SEM bars (TRUE/FALSE)

errorbarwidth

width of

pd

amount to use for dodge (use if multiple groups/lines)

Value

a ggplot object

Examples

library(ggplot2)
# Tree Growth

# just summary stats
p <- ggplot(Orange, aes(x = age, y = circumference)) + 
  geom_pointline_sem(pd=0) +
  theme_classic()
p 
# add individual data
p + geom_line(aes(x = age, y = circumference, group = Tree), inherit.aes = F, color = "black", alpha =0.3) 

# Indomethacin PK
p <- ggplot(Indometh, aes(x = time, y = conc)) + 
  geom_pointline_sem(pd=0) +
  scale_y_log10()
  p
 p + geom_line(aes(x = time, y = conc, group = Subject), inherit.aes = F, color = "black", alpha =0.3)

JMLuther/tabletools documentation built on July 1, 2024, 2:01 p.m.