aest_level_and_change: Level and Change Plot.

View source: R/aest_level_and_change.R

aest_level_and_changeR Documentation

Level and Change Plot.

Description

Makes a two panel plot of the levels and changes of a non-negative variable

Usage

aest_level_and_change(
  df,
  x_var,
  y_var,
  date_format,
  what_change = "annual",
  title = NULL,
  scale_y = "identity",
  last_n = NULL,
  caption = NULL,
  caption_size = 5
)

Arguments

df

a dataframe that contains the variable of interest, a column with a time index, and the file_name column.

x_var

the column that contains the time index.

y_var

The variable to plot on y axis

date_format

the date format: see details.

what_change

either "annual" or "from_last"

title

Optional title to include.

scale_y

fed into ggplot's scale_y_continuous(trans=scale_y). E.g. "log", "sqrt".

last_n

Option to only use the last_n observations.

caption

Over-rides the default caption (variable and file)

caption_size

the font size for the caption, Default=5

Details

Dataframe df MUST contain a column file_name, which is shown in the plot caption.

Value

a two panel plotly object.

Examples

## Not run: 
if(interactive()){
 #EXAMPLE1
 }

## End(Not run)

rpmartin/aest documentation built on Oct. 22, 2022, 6:33 p.m.