leaf_plot: Function to create a leaf plot

View source: R/leaf_plot.R

leaf_plotR Documentation

Function to create a leaf plot

Description

This functions taked a data.frame and returns a gtable with three plots. The left-leafes, the axis names and the right-leafes.

Usage

leaf_plot(
  dta,
  label = "name",
  valueLeft = "var1",
  valueRight = "var2",
  titleLeft = NULL,
  titleRight = NULL,
  colorLeft = "#FF7F50",
  colorRight = "#20B2AA"
)

Arguments

dta

data.frame with, at last, three columns corresponding to the axis labels, the left values and the right values.

label

(default "name") Name of the column in dta with the labels.

valueLeft

(default "var1") Name of the column with the values for the left plot.

valueRight

(default "var2") Name of the column with the values for the right plot.

titleLeft

(default NULL) Character used as a title for the left plot.

titleRight

(default NULL) Character used as a title for the right plot.

colorLeft

(default "#FF7F50") Color for left plot bars.

colorRight

(default "#20B2AA") Color for right plot bars.

Value

A ggplo2 object.

Examples

data <- data.frame(
   labels = LETTERS[1:15],
   right = runif(n = 15) * 11,
   left = runif(n = 15) * 9
)
leaf_plot( data, "labels", "left", "right", "runif09", "runif11")

isglobal-brge/CTDquerier documentation built on Oct. 6, 2022, 1:18 p.m.