Description Usage Details Value Examples
The function is used with ggplot2 to produce annotation for the earthquake
data. For input arguments, please refer to geom_point
for further
details. An optional argument n_max can be specified to indicate how many
points should be annotated. Another aes byCol can be specified to indicate
how the n_max rows be selected. If byCol is specified, the highest n_max rows
according to byCol will be selected. if no byCol is specified, n_max rows
will be selected randomly.
1 2 3 4 |
Note that for meaningful outcome, it is expected this function is accompanied
with geom_timeline
when plotting. Otherwise, there will only
be annotations with no reference to the point and axis. In light of that,
both geoms should be "given the same data", i.e. aes mapping shoud be done
for xmin and xmax if they are required. Refer to example / vigenette.
layer annotation object for plotting purpose
1 2 3 4 5 6 7 | ## Not run: ggplot(data = selected) + aes(x=DATE, y=COUNTRY, colour =
TOTAL_DEATHS, size = EQ_PRIMARY, label=LOCATION_NAME, byCol=EQ_PRIMARY,
xmin = xmin, xmax = xmax) + geom_timeline() + geom_timelabel(n_max=5) +
theme_timeline() + scale_size_continuous(name = "Richter scale value") +
#change legend name scale_colour_continuous(name = "# Deaths") +
scale_x_date(limits = c(xmin-months(6), xmax+months(6))) #extend the axis
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.