Description Usage Arguments Details Examples
Creates a calendar plot of a time series of continuous or discrete data. The time series data frame input to this function must have only two columns, one for the date and one with the values to plot.
1 2 | calendar_plot(df, type = "continuous", labels = NULL,
legend_name = "Exposure")
|
df |
Data frame with one column named |
type |
Character string specifying whether the exposure is continuous or discrete |
labels |
Vector of character strings naming the levels of a discrete variable to be used in the figure legend. |
legend_name |
Character string specifying the title to be used in the figure legend. |
The output of this function is a ggplot
object, so you can customize
this output object as with any ggplot
object.
1 2 3 4 | testdat <- sim_exposure(n = 1000, central = 0.1,
exposure_type = "binary")
testdat$x[c(89,101,367,500,502,598,678,700,895)] <- 3
calendar_plot(testdat, type = "discrete", labels = c("no", "yes", "maybe"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.