Description Usage Format Details Value Parameters to Geom Examples
for plotting a time line of earthquakes ranging from xmin to xmaxdates with a point for each earthquake. Optional aesthetics include color, size, and alpha (for transparency).
1 |
An object of class GeomTimeline
(inherits from Geom
, ggproto
, gg
) of length 5.
The data to be used with this geom must be downloaded and readed from NOAA site, https://www.ngdc.noaa.gov/nndc/struts/form?t=101650&s=1&d=1.
foplotting a time line of earthquakes ranging from xmin to xmaxdates with a point for each earthquake
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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
filename <- system.file("extdata", "signif.txt", package="earthquakeGeoms")
library(readr)
input <- readr::read_delim(filename, delim = "\t")
sample <- input %>%
eq_clean_data() %>%
eq_location_clean("LOCATION_NAME")%>%
filter(YEAR >= 2000) %>%
filter(COUNTRY %in% c("USA", "MEXICO"))
ggplot2::ggplot(data=sample, aes(x = date, y = COUNTRY, color = DEATHS, size = EQ_PRIMARY)) +
geom_timeline() +
scale_size_continuous(name = 'Richter scale value', guide = guide_legend(order = 1)) +
scale_color_continuous(name = '# of Deaths', guide = guide_colorbar(order = 2))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.