Description Usage Arguments Value See Also Examples
View source: R/podlove_plot_curves.R
Wrapper function to prepare and generate a line curve diagram
of downloads over time. It takes an optional grouping variable (e.g.
title) as well as options for the time axis of downloads for cumulative display,
labeling and print output. If you want to generate and tweak the data
behind this plot, use podlove_prepare_stats_for_graph.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
dldata |
A tidy data frame with download data, as constructed
by |
gvar |
Optional grouping parameter (e.g. episode title), handed over
to |
relative |
Boolean switching parameter to define if the data is
rendered relative to the respective episode release date ( |
cumulative |
Boolean switch to show either cumulative data (TRUE, default), or non-comulative data (FALSE) |
plot_type |
Sets the plot type to either line plot ( |
labelmethod |
Defines where should the labels be attached
(at the beinning of the curves: |
printout |
Switcher to automatically print out the plot (default TRUE) |
last_n |
Number of most recent episodes to filter for. Defaults to 0 (no filtering), use negative numbers to filter for first n episodes. |
sum_fun |
Summary function used to draw a (smoothed) curve over all
|
limit |
Boolean switch to fix axis limtis (relevant when adding smoothers) |
... |
additional formating parameters for |
hourly |
Boolean switching parameter for rendering of hourly vs.
daily data. Defaults to |
A ggplot object
podlove_graph_download_curves(), podlove_prepare_stats_for_graph()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # create example data
dls <- podlove_create_example(clean = TRUE)
podlove_plot_curves(dls, gvar = title, relative = TRUE, cumulative = TRUE)
# add a mean curve
podlove_plot_curves(dls, gvar = title, relative = TRUE, cumulative = TRUE,
sum_fun = mean)
# show only the last 4 episodes' curves. Note how the summary curve remains
# the same as in the plot before.
podlove_plot_curves(dls, gvar = title, relative = TRUE, cumulative = TRUE,
sum_fun = mean, last_n = 4)
# see podlove_graph_download_curves() for additional information.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.