gg_tmd: Tukey's Mean-Difference plot for one-way data

Description Usage Arguments Value Examples

View source: R/gg_tmd.R

Description

Returns Tukey's Mean-Difference plot for one-way data

Usage

1
gg_tmd(df, vble, group, xlabel = "Mean", ylabel = "Difference", ...)

Arguments

df

dataframe

vble

numeric variable to be analized

group

character or factor grouping variable

xlabel

label for x-axis, defaults to "Mean"

ylabel

label for y-axis, defaults to "Difference"

...

parameters to be passed to geom_point(), such as size, color, shape.

Value

a ggplot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(dplyr)
data(futbol)

# Multiple groups
gg_tmd(futbol, dist, longp)
gg_tmd(futbol, dist, longp, size = 0.4, color = "red", shape = 3)

# Only 2 groups
futbol %>%
  filter(longp %in% c("< 0.81 m", "0.81 a 0.90 m")) %>%
  gg_tmd(dist, longp)

ggcleveland documentation built on Aug. 16, 2021, 9:07 a.m.