plot_spaghetti: Spaghetti plot

Description Usage Arguments Value Examples

View source: R/plot-spaghetti.R

Description

Spaghetti plot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_spaghetti(
  data,
  id,
  observations,
  observations_label = observations,
  value,
  value_label = value,
  SESOI_lower = 0,
  SESOI_upper = 0,
  control = plot_control()
)

Arguments

data

Data frame

id

Character string. Name of the column in data

observations

Character string. Name of the column in data

observations_label

Character string. Label to be used for x-axis. Default is observations

value

Character string. Name of the column in data

value_label

Character string. Label to be used. Default is value

SESOI_lower

Lower smallest effect size of interest threshold

SESOI_upper

Upper smallest effect size of interest threshold

control

Plotting control object returned from plot_control

Value

ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
test_data <- expand.grid(
  id = 1:10,
  obs = 1:10
)

test_data$val <- with(
  test_data,
  rnorm(nrow(test_data), obs, id)
)

plot_spaghetti(
  test_data,
  id = "id",
  observations = "obs",
  value = "val",
  SESOI_lower = -1,
  SESOI_upper = 1,
  control = plot_control(
    points_shape = 21,
    points_fill = "white",
    points_alpha = 1,
    points_size = 0.75,
    line_size = 0.75,
    legend_position = "right"
  )
)

mladenjovanovic/bmbstats documentation built on Aug. 5, 2020, 4:20 p.m.