podlove_baseplot: Construct a basic podcast download line plot

Description Usage Arguments Value Examples

View source: R/podlove_baseplot.R

Description

Creates the basic line plot to display Podlove download data over time, using ggplot2(). Includes an optional grouping variable and a switcher between cumulative/non-cumulative data.

Usage

1
2
3
4
5
6
7
8
podlove_baseplot(
  df_tidy_data,
  gvar = "Total",
  cumulative = TRUE,
  limit = TRUE,
  legend = FALSE,
  ...
)

Arguments

df_tidy_data

A tidy data frame with download data, as constructed by podlove_prepare_stats_for_graph()

gvar

Optional grouping parameter string (e.g. "title"), handed over to ggplot2::aes_string(color). Must correspond to the data structure in df_tidy_data.

cumulative

Boolean switch to show either cumulative data (TRUE, default), or non-comulative data (FALSE)

limit

Boolean switch to fix axis limtis (relevant when adding smoothers)

legend

Boolean switch to add a legend

...

Additional parameters to be handed over to ggplot2::geom_line()

Value

A ggplot2 plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run:  
#prepare data
gdata <- podlove_prepare_stats_for_graph(podcast_example_data, gvar = title)

# line graph with cumulative data (grouped by title)
podlove_baseplot(plot_data, gvar = "title", cumulative = TRUE)

# line graph with non-cumulative data
podlove_baseplot(plot_data, gvar = "title", cumulative = FALSE)

# line graph with non-cumulative data and additional display parameters
podlove_baseplot(plot_data, gvar = "title", cumulative = FALSE,
                 alpha = 0.3, size = 5)

# line graph with ungrouped cumulative data
gdata <- podlove_prepare_stats_for_graph(podcast_example_data)
podlove_baseplot(plot_data, cumulative = TRUE)

## End(Not run)

lordyo/podlover documentation built on Feb. 20, 2020, 5:58 p.m.