line_plot: line_plot: Creates a simple line plot of searches over time

View source: R/arima-spikes-onegeo.R

line_plotR Documentation

line_plot: Creates a simple line plot of searches over time

Description

line_plot: Creates a simple line plot of searches over time

Usage

line_plot(
  df,
  geo = "US",
  beginplot = T,
  endplot = T,
  interrupt,
  linelabel = "Interruption",
  linelabelpos = 0.02,
  title = NULL,
  xlab = "Date",
  ylab = "Query Fraction\n(Per 10 Million Searches)",
  lbreak = "1 year",
  ylim = NULL,
  hicol = NA,
  locol = NA,
  nucol = NA,
  opcol = NA,
  colorscheme = "red",
  xfmt = date_format("%b %Y"),
  lwd = 0.3,
  extend = F,
  width = 6,
  height = 3,
  save = T,
  outfn
)

Arguments

df

The dataframe as outputted by run_arima.

geo

The column name of the geography of searches that you want.

beginplot

The date you want the plot to start. Default is beginning of the time series.

endplot

The date you want the plot to end. Default is end of the time series.

interrupt

The date of the interruption (should be the same as run_arima)

linelabel

Label next to the vertical interruption line

title

The title of the figure. The default is no title.

xlab

The label for the x axis

ylab

The label for the y axis

lbreak

The distance between tick marks in the x axis, i.e., "one year" or "3 month"

lwd

Line width

width

Width of the plot in inches

height

Height of the plot in inches

save

Default is True. If False, the plot is not saved.

outfn

Where to save the plot.

Examples

line_plot(
  df,
  beginplot = T,
  endplot = T,
  interrupt = ymd("2019-12-19")
  linelabel = "Interruption",
  title = NULL,
  xlab = "Date",
  ylab = "Query Fraction (Per 10 Million Searches)",
  lbreak = "1 year",
  lwd = 0.3,
  width = 6,
  height = 3,
  save = T,
  outfn = './output/panA.png'
)

tlcaputi/gtrendR documentation built on Nov. 3, 2022, 10:46 p.m.