geom_timeline: Plot a timeline of earthquakes within a given time frame

Description Usage Arguments Value Examples

Description

This function utilizes the GeomTimeline geom to plot the earthquake events. In the provided example, the color aes reflects the number of deaths resulted from the earthquake with grey ones indicating no data available. The size aes reflects the magnitude of the eqrthquake. The X-axis is the date.

Usage

1
2
3
geom_timeline(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = TRUE, show.legend = NA,
  inherit.aes = TRUE, ...)

Arguments

mapping

Aesthetic mappings created by aes

data

Dataset from NOAA website

stat

The statistical transformation used

position

Position adjustment function

na.rm

Remove the NA values from the data frame

show.legend

Legend

inherit.aes

Default aesthetics

...

Other arguments

Value

The timeline plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#Pick data points ranging from date \code{xmin} to \code{xmax} from the cleaned dataset to plot
           ## Not run: eq_tidy_data <- eq_clean_data(eq_download_data())
           ## Not run: xmin <- as.Date("1999-01-01")
           ## Not run: xmax <- as.Date("2000-01-01")
           ## Not run: sample_data <- filter(eq_tidy_data, DATE >= xmin & DATE <= xmax)
           ## Not run: ggplot(sample_data,
                   aes(x = DATE, size = EQ_PRIMARY, fill = DEATHS, color = DEATHS)) +
                   geom_timeline() +
                   theme_minimal()
## End(Not run)

perfectslumber/NOAAsignif documentation built on May 23, 2019, 5:04 a.m.