Description Usage Arguments Value Examples
This function utilizes the GeomTimelineLable
geom to plot the earthquake events with
labels (location of the earthquake). There is an option to subset to n_max number of earthquakes, where we take the n_max
largest (by magnitude) earthquakes. 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. n_max can be customized, the default value is 5.
1 2 3 |
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 |
The labeled timeline plot.
1 2 3 4 5 6 7 8 9 10 11 | #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("1999-07-01")
## Not run: sample_data <- filter(eq_tidy_data, DATE >= xmin & DATE <= xmax)
## Not run: ggplot(sample_data,
aes(x = DATE, label = LOCATION, size = EQ_PRIMARY, fill = DEATHS,
color = DEATHS, n_max = 4)) +
geom_timeline_label() +
theme_minimal()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.