epicurve | R Documentation |
epikml() takes a set of coordinates and other associated info as input, and creates a KML (Keyhole Markup Language) file that can be opened with Google Earth or other similar programs. It's original intention was to plot disease cases, but can find wider use as well.
epicurve(
x,
series = NA,
col = "green",
xlim = range(x, na.rm = TRUE) + xmargin * c(-1, 1),
ymax = NA,
xlab = NA,
ylab = NA,
xaxt = "s",
yaxt = "s",
box = FALSE,
xmargin = 2
)
x |
Data vector of integers or 'Date' objects |
series |
Factor of equal length as x, used to group cases and color them separately |
col |
Color, or vector of colors of length equal to the levels of |
xlim |
Limits for the x axis. Defaults to the range of |
ymax |
Maximum for the y axis. Leaving |
xlab |
Title for x axis |
ylab |
Title for y axis |
xaxt |
x axis type. Specifying |
yaxt |
y axis type. Specifying |
box |
If FALSE, rectangles are drawn with the appropriate aspect ratio to fit the range of both axes. If TRUE, the function adjusts the length of the y axis so that squares are drawn |
xmargin |
When drawing the x axis and the limits are not explicitly set, extend the range of x by this amount and use that as the limits of the x axis. |
Scales are NOT drawn for either axis. Use axis
to draw them
explicitly to your liking.
Nothing. The function plots the epidemic curve on the current graphics device.
# Create some dummy data
sampdates <- seq(as.Date("2016-07-15"), as.Date("2016-09-15"), 1)
x <- sample(sampdates, 120, rep=TRUE)
gender <- sample(c("Male","Female"), 120, rep=TRUE)
# Draw the epidemic curve
epicurve(x, gender, c("skyblue","pink"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.