plot_trend: Plot trendline for run_visual_dive()

Description Usage Arguments See Also Examples

View source: R/data-dive.R

Description

To be run from run_visual_dive. This will plot a count of participants, optionally facetted down and/or across by additional variables. If facetting (i.e., grouping) missing values will be removed from the corresponding variables before plotting.

Usage

1
plot_trend(tbl, down = "None", across = "None")

Arguments

tbl

data frame holding table produced by summarize_trend

down

variable name for optional facetting down. If "None", no facetting will be done.

across

variable name for optional facetting across. If "None", no facetting will be done.

See Also

Other data dive functions: drop_state_code(), filter_demo(), get_county_map_dive(), load_cust_samp(), plot_county_dive(), plot_dist(), run_visual_dive(), set_nonres_county_na(), set_other_county_na(), summarize_trend()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(dplyr)
data(hist_samp)
priv <- filter(hist_samp, priv == "all_sports")

summarize_trend(priv, pct = 1) %>% plot_trend()
summarize_trend(priv, "sex", pct = 1) %>% plot_trend("sex")
summarize_trend(priv, "sex", "age", pct = 1) %>% plot_trend("sex", "age")

summarize_trend(priv, pct = 1, metric = "churn") %>% plot_trend()
summarize_trend(priv, "sex", pct = 1, metric = "churn") %>% plot_trend("sex")

southwick-associates/sadash documentation built on Jan. 6, 2022, 5:17 p.m.