waterfalls_plot: Generate waterfall plot using R package waterfalls.

Description Usage Arguments Value Examples

View source: R/waterfalls.R

Description

Generate waterfall plot using R package waterfalls.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
waterfalls_plot(
  waterfallsinput,
  sep = "\t",
  row.names = NULL,
  header = T,
  quote = "",
  comment = "",
  check.names = F,
  labels,
  values = NULL,
  rect_text_labels = "",
  rect_text_size = 1,
  put_rect_text_outside_when_value_below = 1,
  calc_total = FALSE,
  draw_lines = TRUE,
  fill_colours = NULL,
  lines_anchors = c("right", "left"),
  linetype = "dashed",
  total_rect_color = "black",
  total_rect_text_color = "white",
  total_axis_text = "Total",
  total_rect_text,
  rect_width = 0.9,
  draw_axis.x = "behind",
  rect_border = "white",
  scale_y_to_waterfall = TRUE,
  fill_by_sign = FALSE,
  theme_text_family = "",
  x_label = NULL,
  y_label = NULL,
  ...
)

Arguments

waterfallsinput

A data.frame containing two columns, one with the values, the other with the labels.

labels

the labels corresponding to each vector, marked on the x-axis.

values

a numeric vector making up the heights of the rectangles in the waterfall.

rect_text_labels

(character) a character vector of the same length as values that are placed on the rectangles.

rect_text_size

size of the text in the rectangles.

put_rect_text_outside_when_value_below

(numeric) the text labels accompanying a rectangle of this height will be placed outside the box: below if it's negative; above if it's positive.

calc_total

(logical, default: FALSE) should the final pool of the waterfall be calculated (and placed on the chart).

draw_lines

(logical, default: TRUE) should lines be drawn between successive rectangles.

fill_colours

Colours to be used to fill the rectangles, in order. Disregarded if fill_by_sign is TRUE (the default).

lines_anchors

a character vector of length two specifying the horizontal placement of the drawn lines relative to the preceding and successive rectangles, respectively.

linetype

the linetype for the draw_lines.

total_rect_color

the color of the final rectangle.

total_rect_text_color

the color of the final rectangle's label text.

total_axis_text

(character) the text appearing on the axis underneath the total rectangle.

total_rect_text

(character) the text in the middle of the rectangle of the total rectangle.

rect_width

(numeric) the width of the rectangle, relative to the space between each label factor.

rect_border

the border around each rectangle. Choose NA if no border is desired.

x_label

The X axis name

y_label

The Y axis name

...
draw_axis_x

(character) one of "none", "behind", "front" whether to draw an x.axis line and whether to draw it behind or in front of the rectangles, default is behind.

Value

pdf image

Examples

1
2
waterfallsinput <- "test.file"
waterfalls_plot(waterfallsinput)

Tong-Chen/YSX documentation built on Jan. 25, 2021, 2:49 a.m.