Skip to contents

Create a Miami plot with a central buffer and fixed axis labels

Usage

miamiplot(
  df,
  group = "group",
  position = "position",
  value_top = "value_top",
  value_bottom = "value_bottom",
  yline_top = NULL,
  yline_bottom = NULL,
  logy = FALSE,
  gap_size = 0.2,
  highlight_colour = NULL,
  annotate_column = NULL,
  annotate = NULL,
  annotate_top = NULL,
  annotate_bottom = NULL,
  colours = c("gray10", "gray60"),
  title = NULL,
  x_axis_title = NULL,
  y_axis_title = "Value",
  y_breaks = NULL,
  ylims = NULL,
  transformation_from = -0.1,
  transformation_to = 0.1,
  transformation = 10,
  ...
)

Arguments

df

A data frame.

group

Column name for groups (X-axis sections). Default is "group".

position

Column name for positions within groups. Default is "position".

value_top

Column name for the top plot values.

value_bottom

Column name for the bottom plot values.

yline_top

Optional. Horizontal line(s) for the top plot.

yline_bottom

Optional. Horizontal line(s) for the bottom plot.

logy

Logical. Whether to -log10 transform the Y-axis values. Default is FALSE.

gap_size

Numeric. The vertical distance to separate the top and bottom plots. Default is 0.2.

highlight_colour

Optional. Colour for points outside the yline thresholds.

annotate_column

Optional. Column name to use for labels.

annotate

Optional. Vector of values from annotate_column to label regardless of Y-axis value.

annotate_top

Optional. Vector of values to label on the top plot.

annotate_bottom

Optional. Vector of values to label on the bottom plot.

colours

Character vector of colours for alternating groups.

title

Optional. Plot title.

x_axis_title

Optional. X-axis title.

y_axis_title

Optional. Y-axis title.

y_breaks

Optional. Y-axis breaks.

ylims

Optional. Y-axis limits.

transformation_from

Numeric. Start of the squished region. Default = -0.1.

transformation_to

Numeric. End of the squished region. Default = 0.1.

transformation

Numeric. Factor for the squished region. Default = 10.

...

Additional arguments.

Value

A ggplot object.