Skip to contents

For Trendlines, we create 3/4 plots on a bi-weekly base. This function saves plots locally (not tracked in Git), on AWS and on Drive. Plots will automatically be updated if you call it again with the same name.

Usage

trendlines_finalise_plot(
  plot,
  object_name,
  bucket_name = NULL,
  drive_id_social = "1Xo4666mpXmRCpB8Rey9xmsjTHXOzewGU",
  drive_id_newsletter = "1lRaI9X_wldGgrQLu7TYLdBjA-qfVfvSV",
  source,
  margin_right = 0,
  margin_bottom = 1,
  margin_top = c(0, 1),
  width_pixels = 900,
  height_pixels = 1000
)

trendlines_finalize_plot(
  plot,
  object_name,
  bucket_name = NULL,
  drive_id_social = "1Xo4666mpXmRCpB8Rey9xmsjTHXOzewGU",
  drive_id_newsletter = "1lRaI9X_wldGgrQLu7TYLdBjA-qfVfvSV",
  source,
  margin_right = 0,
  margin_bottom = 1,
  margin_top = c(0, 1),
  width_pixels = 900,
  height_pixels = 1000
)

Arguments

plot

A ggplot object.

object_name

Object name for AWS and local. Should NOT include ".png".

bucket_name

Bucket name to save the plot on for AWS.

drive_id_social

Google Drive folder ID to store the social plot. Will be wrapped in googledrive::as_id().

drive_id_newsletter

Google Drive folder ID to store the newsletter plot. Will be wrapped in googledrive::as_id().

source

A Character string. Source of the data that is displayed on the bottom right.

margin_right

Margin to put on the right side for the newsletter version.

margin_bottom

Margin to put on the bottom side of both newsletter and social version.

margin_top

Margin to put on the top side of both newsletter (first value) and social (second value) version.

width_pixels

Defaults to 900.

height_pixels

Defaults to 1000.