trendline | R Documentation |
Creates a peer city trendline graph using a GLP-style data frame.
Columns FIPS
and year
are required columns.
Columns , sex
, and race
are optional columns.
trend(
df,
var,
rollmean = 1,
xmin = "",
xmax = "",
peers = "current",
cat = "",
plot_title = "",
y_title = "",
caption_text = "",
subtitle_text = "",
ylimits = "",
pctiles = T,
use_var_type = F,
shading = F,
label_function = NULL,
axis_function = NULL,
year_breaks = NULL,
endpoint_labels = TRUE
)
trend_maxmin(
df,
var,
rollmean = 1,
xmin = "",
xmax = "",
peers = "current",
order = "descending",
plot_title = "",
y_title = "",
caption_text = "",
subtitle_text = "",
zero_start = F,
ylimits = "",
use_var_type = F,
label_function = NULL,
axis_function = NULL,
year_breaks = NULL,
endpoint_labels = TRUE,
max_city = "",
min_city = ""
)
trend_data(
df,
var = "var",
rollmean = 1,
xmin = "",
xmax = "",
peers = "current",
cat = "",
pctiles = T,
use_var_type = F
)
trend_data_maxmin(
df,
var = "var",
rollmean = 1,
xmin = "",
xmax = "",
peers = "current",
order = "descending",
zero_start = F,
use_var_type = F,
max_city = "",
min_city = ""
)
df |
A data frame |
var |
The variable name, can be quoted or unquoted |
rollmean |
A rolling mean. Defaults to 1. |
xmin |
First year |
xmax |
Last year |
peers |
|
cat |
A character vector that specifies a demographic category. Can be |
plot_title |
Plot title |
y_title |
Y-axis title. Defailts to |
caption_text |
Caption text in the bottom right of the graph. |
subtitle_text |
Subtitle text |
ylimits |
A vector of the form |
pctiles |
Include 25thand 75th percentile lines on graph? Defaults to |
shading |
Replace 25th and 75th percentile lines with shaded areas? (Currently not working.) |
label_function |
A unique label function to be used in place of the default selected based on |
axis_function |
A unique axis label function to be used in place of the default selected based on |
order |
|
zero_start |
For max_min functions: should the lines all begin at 0? Defaults to |
The parameters are organized into six sections:
Required: df
, var
Filter and Adjust Data: rollmean
, xmin
, xmax
, peers
, order
Add Text to Graph: plot_title
, y_title
, caption_text
, subtitle_text
Graph Elements: zero_start
, ylimits
, pctiles
, shading
Manipulate Labels: label_function
, axis_function
trend()
: Creates a peer city trendline graph using a GLP-style data frame.
trend_maxmin()
: Creates a peer city max-min graph using a GLP-style data frame.
trend_data()
: Returns the data frame used in the trendline graph
trend_data_maxmin()
: Returns the data frame used in the max-min graph
trend(education_county, "bach_plus")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.