Skip to content

Embed Tweets in R Markdown

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

gadenbuie/tweetrmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tweetrmd

Easily embed Tweets anywhere R Markdown turns plain text into HTML.

Installation

You can install the released version of tweetrmd from GitHub:

# install.packages("devtools")
devtools::install_github("gadenbuie/tweetrmd")

Embed a Tweet

library(tweetrmd)

tweet_embed("https://twitter.com/alexpghayes/status/1211748406730706944")

anybody have experience embedding tweets into #rmarkdown documents without using blogdown?https://t.co/5kQUBh7j4g

— alex hayes (@alexpghayes) December 30, 2019

Or if you would rather use the screen name and status id.

tweet_embed(tweet_url("alexpghayes", "1211748406730706944"))

anybody have experience embedding tweets into #rmarkdown documents without using blogdown?https://t.co/5kQUBh7j4g

— alex hayes (@alexpghayes) December 30, 2019

Take a screenshot of a tweet

Screenshots are automatically embedded in R Markdown documents, or you can save the screenshot as a .png or .pdf file. Uses the rstudio/webshot2 package.

tweet_screenshot(tweet_url("alexpghayes", "1211748406730706944"))

Customize tweet appearance

Twitter’s oembed API provides a number of options, all of which are made available for customization in tweet_embed() and tweet_screenshot().

tweet_screenshot(
  tweet_url("alexpghayes", "1211748406730706944"),
  maxwidth = 300,
  hide_media = TRUE,
  theme = "dark"
)


Note: When using tweet_embed(), you may need to add the following line to your YAML header for strict markdown output formats.

always_allow_html: true

About

Embed Tweets in R Markdown

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published