leaf_plot: Function to create a leaf plot

Description Usage Arguments Value Examples

View source: R/leaf_plot.R

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

1
2
3
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

1
2
3
4
5
6
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")

CTDquerier documentation built on Oct. 31, 2019, 2:57 a.m.