Description Usage Arguments Value Examples
View source: R/prepare_trend_graph.R
Reads a data frame and line plots all variables (which need to be numeric) by an ordered factor (normally the time-series indicator).
1 2 3 4 5 | prepare_trend_graph(
df,
ts_id,
var = colnames(df[sapply(df, is.numeric) & colnames(df) != ts_id])
)
|
df |
Data frame containing the ordered factor and a set of numerical variables to be plotted |
ts_id |
a string containing the column name of the ordered factor (normally the time-series indicator) |
var |
a character vector containing the column names of the variables
that should be plotted. Defaults to all numeric variables of the data frame
besides the one indicated by |
A list containing two items:
A data frame containing the plotted means and standard errors
The plot as returned by ggplot
1 2 3 | df <- data.frame(year = floor(time(EuStockMarkets)), EuStockMarkets)
graph <- prepare_trend_graph(df, "year")
graph$plot
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.