plot_metric_condensed: Plot a condensed metric

Description Usage Arguments Examples

View source: R/plots.R

Description

Plot a condensed metric

Usage

1
2
plot_metric_condensed(metric, dimension = "all", plot_type = NULL,
  quietly = TRUE, ...)

Arguments

metric

a tbl_metric object

dimension

a string indicating the dimension to visualize

plot_type

a string indicating type of plot (line/bar)

quietly

a boolean indicating if messages should be suppressed

...

additional parameters passed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
## Not run: 
  library(dplyr)
  metrics_condensed <- datacampr::dc_s3_read(
    'metrics_condensed.rds'
  )$metrics_condensed
  metric %>%
    filter(period == 'week') %>%
    filter(date >= Sys.Date() - 365) %>%
    plot_metric_condensed()

 metrics_condensed$product_time_median_time_spent %>%
   filter(period == 'week') %>%
   filter(date >= Sys.Date() - 365) %>%
   plot_metric_condensed_line(dimension = 'subscription_type')

 metrics_condensed$content_courses_avg_rating_wtd %>%
   filter(period == 'rolling_28d') %>%
   filter(date >= Sys.Date() - 365) %>%
   plot_metric_condensed()

 metrics_condensed$content_courses_avg_rating_wtd %>%
   filter(period == 'rolling_28d') %>%
   filter(date >= Sys.Date() - 365) %>%
   plot_metric_condensed('ds_track')

 flights_nyc_avg_arr_delay %>%
   filter(period == 'week') %>%
   plot_metric_condensed(plot_type = 'bar')

 flights_nyc_avg_arr_delay %>%
   filter(period == 'week') %>%
   plot_metric_condensed(plot_type = 'bar', dimension = 'origin')

 flights_nyc_avg_arr_delay %>%
   filter(period == 'week') %>%
   plot_metric_condensed(plot_type = 'line')

 flights_nyc_avg_arr_delay %>%
   filter(period == 'week') %>%
   plot_metric_condensed(plot_type = 'line', dimension = 'origin')

## End(Not run)

ramnathv/shinymetrics documentation built on June 29, 2020, 10:39 p.m.