mjs_add_marker: Sets a marker line/label

Description Usage Arguments Value Examples

Description

metricsgraphics marker lines are vertical lines that identify, say, events or dates worth annotating. This function lets you add a marker to a plot object. you can add as many as you need to.

Usage

1
mjs_add_marker(mjs, x_value, label)

Arguments

mjs

metricsgraphics plot object

x_value

which x value to draw the marker at

label

text label for the marker

Value

metricsgraphics object

Examples

1
2
3
4
5
6
7
8
data.frame(
  year=seq(1790, 1970, 10),
  uspop=as.numeric(uspop)
) %>%
  mjs_plot(x=year, y=uspop) %>%
  mjs_line() %>%
  mjs_add_marker(1850, "Something Wonderful") %>%
  mjs_add_baseline(150, "Something Awful")

Example output



metricsgraphics documentation built on May 1, 2019, 8:07 p.m.