Introduction to R and the tidyverse
Alex Richards · 2023
Many journalism professionals have embraced R, a free, statistics-focused programming language with roots in academia, because of its ability to save time, enhance the transparency of their reporting, and reproduce complicated analyses and visualizations with minimal effort. It also allows them to do things spreadsheets cannot do very well. While R is endlessly expandable, this section focuses on the fundamentals of the tidyverse, a suite of free tools that make R more accessible for data journalism. This chapter gives background on how scripting languages like R can be used in journalism. It covers the necessary free software tools—R, RStudio and the tidyverse—that can be installed locally and how they interact with one another. Topics include navigating the software, basic syntax through a command line interface, and key concepts like data frames and variables, explained through the lens of a spreadsheet from previous chapters.