knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) # loading libraries library(TidyTuesdayAltText) library(tidyverse) source("data-raw/createDataDictionary.R")
The goal of TidyTuesdayAltText
is to provide insight into the alternative (alt) text accompanying the data visualizations shared on Twitter as part of the TidyTuesday social project^[rfordatascience/tidytuesday: Official repo for the #tidytuesday project].
<!-- You can install the released version of TidyTuesdayAltText from CRAN with:
install.packages("TidyTuesdayAltText")
-->
You can install the development version of TidyTuesdayAltText
from GitHub with:
# install.packages("devtools") devtools::install_github("spcanelon/TidyTuesdayAltText")
While this repo is private, you will first have to make sure to provide authentication to GitHub using a Personal Access Token (PAT) as a credential. You can follow the steps in the credential caching chapter of Happy Git with R (summarized below): Chapter 10 Cache credentials for HTTPS | Happy Git and GitHub for the useR
Create a personal access token using a usethis
package helper function which pre-selects recommended scopes/permissions: usethis::create_github_token()
Then store your token somewhere safe and treat it like you would a password.
Call an R function to store your credentials using the credentials
package which will prompt you to enter your token: credentials::set_github_pat()
This populates the GITHUB_PAT
environment variable that install_github()
defaults to as the authentication token (i.e. auth_token) argument.
Finally, proceed to install the package as usual: devtools::install_github("spcanelon/TidyTuesdayAltText")
The package contains 5 datasets:
library(TidyTuesdayAltText) ?ttTweets2018 ?ttTweets2019 ?ttTweets2020 ?ttTweets2021 ?AltTextSubset
Original data were collected and made available by Tom Mock (\@thomas_mock) using {rtweet}.
Tweets were processed and scraped for alternative text by Silvia Canelón (\@spcanelon)
Alternative (alt) text was scraped from tweet images using {RSelenium}. The first image attached to each tweet was considered the primary image and only the primary image from each tweet was scraped for alternative text. The following attributes were used to build the scraper:
CSS selector: .css-1dbjc4n.r-1p0dtai.r-1mlwlqe.r-1d2f490.r-11wrixw
aria-label
knitr::include_graphics("man/figures/webInspection.png")
This data package does not include data that could directly identify the tweet author in order to respect any author's decision to delete a tweet or make their account private after the data was originally collected.^[Developer Policy – Twitter Developers | Twitter Developer]
To obtain the tweet text, author screen name, and many other tweet attributes, you can "rehydrate" the TweetId
s (or "status" ids^[Tweet object | Twitter Developer]) using the {rtweet} package.^[Get tweets data for given statuses (status IDs). — lookup_tweets • rOpenSci: rtweet]
A dataset containing the alternative text for media shared between 2018 and 2021 as part of the TidyTuesday social project, and other attributes of 441 tweets. This is a subset of the 2018-2021 datasets, containing only tweets with alternative text that isn't "Image," the default alternative text added by the Twitter app in the absence of customized alternative text. More information can be found using ?AltTextSubset
.
createDataDictionary(AltTextSubset) dataDictionary %>% knitr::kable(escape = TRUE)
Link to the raw data: data-raw/ttTweets2021.csv
A dataset containing the alternative text for media shared in 2021 as part of the TidyTuesday social project, and other attributes. More information can be found using ?ttTweets2021
.
createDataDictionary(ttTweets2021) dataDictionary %>% knitr::kable()
Link to the raw data: data-raw/ttTweets2020.csv
A dataset containing the alternative text for media shared in 2020 as part of the TidyTuesday social project, and other attributes. More information can be found using ?ttTweets2020
.
createDataDictionary(ttTweets2020) dataDictionary %>% knitr::kable()
Link to the raw data: data-raw/ttTweets2019.csv
A dataset containing the alternative text for media shared in 2019 as part of the TidyTuesday social project, and other attributes. More information can be found using ?ttTweets2019
.
createDataDictionary(ttTweets2019) dataDictionary %>% knitr::kable()
Link to the raw data: data-raw/ttTweets2018.csv
A dataset containing the alternative text for media shared in 2018 as part of the TidyTuesday social project, and other attributes. More information can be found using ?ttTweets2018
.
createDataDictionary(ttTweets2018) dataDictionary %>% knitr::kable()
(placeholder)
(placeholder)
To cite the TidyTuesdayAltText package, please use:
citation("TidyTuesdayAltText")
Data and hex logo originally published in:
Many thanks to Liz Hare (\@DogGeneticsLLC) for testing the package in development and performing the analyses that went into our CSV Conf 2021 talk.
And thank you to the following resources for providing guidance and inspiration for how this package was organized and documented:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.