Skip to contents

Producing tornado plots

Usage

plotTornado(
  data = NULL,
  metaData = NULL,
  x = NULL,
  y = NULL,
  sorted = NULL,
  colorPalette = NULL,
  bar = TRUE,
  dataMapping = NULL,
  plotConfiguration = NULL,
  plotObject = NULL
)

Arguments

data

A data.frame to use for plot.

metaData

A named list of information about data such as the dimension and unit of its variables.

x

Numeric values to plot along the x axis. Only used instead of data if data is NULL.

y

Character values to plot along the y axis. Only used instead of data if data is NULL.

sorted

Optional logical value defining if y values are sorted by absolute values of x.

colorPalette

Optional character values defining a ggplot2 colorPalette (e.g. "Spectral")

bar

Optional logical value setting tornado plot as bar plot instead of scatter plot.

dataMapping

A TornadoDataMapping object mapping x, y and aesthetic groups to their variable names of data.

plotConfiguration

An optional TornadoPlotConfiguration object defining labels, grid, background and watermark.

plotObject

An optional ggplot object on which to add the plot layer

Value

A ggplot object

Examples

# Produce a tornado plot
plotTornado(x = c(2, -1, 3), y = c("A", "B", "C"))


# Produce a tornado plot as scatter plot
plotTornado(x = c(2, -1, 3), y = c("A", "B", "C"), bar = FALSE)


# Produce a tornado plot as is (no sorting)
plotTornado(x = c(2, -1, 3), y = c("A", "B", "C"), sorted = FALSE)