Description Usage Arguments Value Examples
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.
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 timeline plot.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.