generate_tweet: Generate a tweet

View source: R/tweets-generate.R

generate_tweetR Documentation

Generate a tweet

Description

Generate a tweet

Usage

generate_tweet(
  pred,
  tweets,
  in_reply_to_tweets,
  preds,
  preds_long,
  shap_long,
  ...,
  prelude = NULL,
  appendix = NULL,
  user = .get_user_bot(),
  dry_run = TRUE,
  delete_plot = !dry_run,
  override = FALSE
)

Arguments

pred

Data frame with {stem}_pred, {stem}_pred_prnk, (team|g|xg)_(h|a), and created_at columns.

tweets

Tweets of the user (punditratio by default) who will be making a reply. Needed to check that a tweet hasn't already been made.

in_reply_to_tweets

Tweets of the user for whom a tweets will be made in reply to (xGPhilosophy by default). Needed for identifying the tweet to reply to.

preds

Predictions with at least team_h, team_a, {stem}_count.

preds_long

Tidy predictions with at least five columns status_id, stem (either favorite or retweet), pred, and count. This will be used to generate a plot to accompany the tweet.

shap_long

Tidy SHAP values with at least four columns status_id, stem (either favorite or retweet), lab, and shap_value. This will be used to generate a plot to accompany the tweet.

...

Extra parameters passed to .save_plot().

prelude, appendix

Extra text to add to beginning or end of auto-generated tweet.

user

Who is making the reply. (pundit_ratio by default.)

dry_run

Whether or not to actually make a tweet.

delete_plot

Whether or not to delete plots made and attached to tweet.

override

Whether or not to override time filtering criteria (useful for testing).


tonyelhabr/xengagement documentation built on June 22, 2022, 5 a.m.