sp_ggplot_add_vline_hline: Add hline or vline for ggplot2 object

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

Add hline or vline for ggplot2 object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
sp_ggplot_add_vline_hline(
  p,
  custom_vline_x_position = NULL,
  custom_vline_anno = NULL,
  custom_vline_anno_y_pos = NULL,
  custom_hline_y_position = NULL,
  custom_hline_anno = NULL,
  custom_hline_anno_x_pos = NULL,
  linetype = "dotted",
  size = 0.5,
  ...
)

Arguments

p

A ggplot2 object

custom_vline_x_position

A vector of coordinates for vertical lines.

custom_vline_anno

Annotation text for each vertical line.

custom_hline_y_position

A vector of coordinates for horizontal lines.

custom_hline_anno

Annotation text for each horizontal line.

...

Extra parameters given to geom_vline and geom_hline

Value

A ggplot2 object

Examples

1
2
3
4
## Not run:
sp_ggplot_add_vline_hline(p)

## End(Not run)

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