R for the Humanities: Why Learn to Program?
Learning to program is often presented as a technical skill, associated with a technology-focused job market. For those of us who come from the social sciences and humanities, that world can feel alien. Our daily work has a different materiality (texts?) and is shaped by questions about language, interpretation, category construction, and situated knowledge production. However, increasingly, technological tools are emerging that allow these two worlds to be intertwined, and more and more people from linguistics, sociology, or political science are working with code and data science.
We often stop to think about what programming brings to those of us who work in these areas, but what can we bring to that world? What new perspectives can we offer on technology? There’s one that seems central to us, which we’ve mentioned several times because it’s at the core of our experience: programming is writing. Beyond the obvious associations between a “natural language” and a “programming language,” we fundamentally believe there’s a textual dimension shared by both texts and scripts. In this context, we propose to view programming not so much as an instrumental skill, but rather as a practice of writing and analysis that dialogues with already familiar concerns.
Programming involves writing instructions in a formal language, but also reading, interpreting, and revising them. An script in R is not just a sequence of commands that “works” or “doesn’t work”: it’s a text that condenses analytical decisions, theoretical assumptions, and methodological choices. Where do we start? How much do we focus on descriptive analysis versus inferential analysis? Do we write alone or do we expect someone else to read us? Do we comment on our text?
Just as we analyze an academic text by asking what concepts it uses, what it leaves out, or how it organizes its argument, code can also be read critically. Learning to program in R, then, opens up the possibility of thinking with data in an explicit and revisable way.
R is especially interesting for this cross-section because it was born and developed in academia. Its widespread use in statistics, linguistics, sociology, psychology, and education sciences is no coincidence. The logic of the language favors exploratory and reflective work with data, where each analysis step can be recorded. Furthermore, its package ecosystem reflects specific disciplinary debates and traditions, which materialize in functions, arguments, and data structures. Paradoxically, many people see the R vs Python debate as an academia vs. industry debate (mostly by those from industry who have negative biases towards academic work).
Something of this is seen in course learning materials: the vast majority focus on instructions on how to perform a specific task, but rarely are there explanations about the intrinsic functioning of the language. In fact, the linguistic aspect of a programming language is rarely highlighted, despite inheriting attributes such as syntax) or semantics. Those of us who come from linguistics and have an ingrained perspective on the formal or combinatorial aspects of structures have an advantage that is not usually mentioned. Rather, the opposite: those from the social sciences and humanities often feel that their way of thinking is different from what is needed to enter the world of technology (we discussed this at #LatinR2024, in Spanish).
From our perspective, learning to program does not mean abandoning practices specific to other areas. On the contrary, it means extending them to a new type of text. Code becomes a space where theory, method, and data are articulated. Tools like RStudio, and practices such as using reproducible scripts or documents in R Markdown, reinforce this idea by integrating code, text, and results into a single medium.
In closing this reflection, it’s worth insisting on a central idea: programming is a situated practice. It is learned in specific contexts, to answer concrete questions, with determined disciplinary traditions. Learning R from the humanities and social sciences does not imply simply adopting an alien language, but rather appropriating it, reading it critically, and using it to think about one’s own problems. Programming, in this sense, is another way of writing, analyzing, and producing knowledge.