GeomTimeline: GeomTimeline

Description Usage Format Value Parameters to Geom Examples

Description

This Geom returns a ggproto object made of a gList of lineGrobs and pointGrobs. Each lineGrob is a straight horizontal line ranging from the minimum x-value to maximum x-value. This horizontal line is done for each unique y-value. The Point grobs are colored based on the colour argument. There will be one point per row.

Usage

1

Format

An object of class GeomTimeline (inherits from Geom, ggproto) of length 5.

Value

This function return a Geom* object containing the line and point Grobs responsible for rendering the images into the plot.

Parameters to Geom

data: A Dataframe Object containing the data to plot.

x: Column of 'data' depicting the x-coordinate of where each of the points will be located.

size: OPTIONAL. Column of 'data' depicting size of each point in the pointsGrob displayed (if missing, the first nmax labels will be displayed).

y: OPTIONAL. Column of 'data' depicting the y-coordinate of where each of the points will be located.

colour: OPTIONAL. Column of 'data' depicting the colour of each point in the pointGrob displayed.

shape: OPTIONAL. Column of 'data' depicting the shape of each of the points.

alpha: OPTIONAL. Column of 'data' which will be used to apply the alpha to each point.

fill: OPTIONAL. Color 'string' (added outside of aes) to modify the default fill of the points (before applying colour).

stroke: OPTIONAL. Stroke of the image (need not be used).

*Note: All of the optional arguments above can be applied as columns of the dataset (inside the function aes), or as individual values (outside of the function aes).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 

## Data Setup

dataset = readr::read_delim("data/signif.txt", delim = "\t") %>%
  eq_clean_data() %>%
  filter(COUNTRY %in% c("USA", "CHINA"), YEAR > 2000)

## Function Call

ggplot2::ggplot(dataset, ggplot2::aes(DATE,
                                      colour = TOTAL_DEATHS,
                                      y = COUNTRY,
                                      size = as.numeric(EQ_PRIMARY) )) +
  geom_timeline() +
  ggplot2::guides(size = ggplot2::guide_legend(title = "Ritcher scale value")) +
  ggplot2::scale_colour_continuous(name = "# of DEATHS") +
  ggplot2::theme_classic()


## End(Not run)

ronybsulca/earthquakeGeoms documentation built on May 6, 2019, 5:03 p.m.