Description Usage Arguments Value Examples
View source: R/prepare_quantile_trend_graph.R
Reads a data frame and plots the quantiles of the specified variable by an ordered factor (normally the time-series indicator)
1 2 3 4 5 6 7 8 |
df |
Data frame containing the ordered factor and the numerical variable to be plotted |
ts_id |
a string containing the column name of the ordered factor (normally the time-series indicator) |
quantiles |
a numerical vector containing the quantiles that are to be plotted |
var |
a string containing the column name of the variable
to be plotted. Defaults to the last numerical variable of the data frame
that is not |
points |
Do you want points to indicate the statistics? Defaults to |
A list containing two items:
A data frame containing the plotted quantiles
The plot as returned by ggplot
1 2 3 4 5 6 | prepare_quantile_trend_graph(worldbank, "year", var = "SP.DYN.LE00.IN")$plot +
ggplot2::ylab("Life expectancy at birth world-wide")
df <- data.frame(year = floor(stats::time(datasets::EuStockMarkets)),
DAX = datasets::EuStockMarkets[,"DAX"])
graph <- prepare_quantile_trend_graph(df, "year", c(0.05, 0.25, 0.5, 0.75, 0.95))
graph$plot
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.