devtools::load_all() library(flexdashboard) library(rtweet) library(vroom) library(dplyr)
rstats_tweets <- readData("data/tweets.csv.gz")
timeline <- make_by_day_metrics(rstats_tweets) n_tweets <- get_unique_value(rstats_tweets, text) n_retweets <- rstats_tweets %>% pull(retweet_count) %>% sum() n_users <- get_unique_value(rstats_tweets, user_id) n_likes <- rstats_tweets %>% pull(favorite_count) %>% sum() tweets_today <- rstats_tweets %>% filter(lubridate::date(created_at) == lubridate::today())
valueBox(n_tweets, icon = "fa-comments")
valueBox(n_retweets, icon = "fa-retweet")
valueBox(n_users, icon = "fa-user")
valueBox(n_likes, icon = "fa-heart")
plot_tweet_volume(timeline)
plot_tweet_by_hour(rstats_tweets)
most_liked_url <- tweets_today %>% slice_max(favorite_count, with_ties = FALSE) get_tweet_embed(most_liked_url$screen_name, most_liked_url$status_id)
most_retweeted <- tweets_today %>% slice_max(retweet_count, with_ties = FALSE) get_tweet_embed(most_retweeted$screen_name, most_retweeted$status_id)
most_recent <- tweets_today %>% slice_max(created_at, with_ties = FALSE) get_tweet_embed(most_recent$screen_name, most_recent$status_id)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.