Skip to main content
QUICK REVIEW

[Paper Review] Expansion and evolution of the R programming language

Timothy L. Staples|arXiv (Cornell University)|Aug 26, 2022
Computational and Text Analysis MethodsSocial Sciences4 citations
TL;DR

This study analyzes 360,321 GitHub repositories (2014–2021) to examine lexical evolution in the R programming language using 168 million function calls. It reveals that R underwent rapid lexical diversification driven by the rise of the tidyverse ecosystem, demonstrating that user-driven cultural forces—similar to those in natural languages—can shape programming language evolution, with significant implications for code readability and long-term software continuity.

ABSTRACT

Change in language use is driven by cultural forces; it is unclear whether that extends to programming languages. They are designed to be used by humans, but interaction with computer hardware rather than a human audience may limit opportunities for evolution of the lexicon of used terms. I tested this in R, an open source, mature and commonly used programming language for statistical computing. In corpus of 360,321 GitHub repositories published between 2014 and 2021, I extracted 168,857,044 function calls to act as n-grams of the R language. Over the eight-year period, R rapidly diversified and underwent substantial lexical change, driven by increasing popularity of the tidyverse collection of community packages. My results provide evidence that users can influence the evolution of programming languages, with patterns that match those observed in natural languages and reflect genetic evolution. R's evolution may have been driven by increased analytic complexity, driving new users to R, creating both selective pressure for an alternate lexicon and accompanying advective change. The speed and magnitude of this change may have flow-on consequences for the readability and continuity of analytic and scientific inquiries codified in R and similar languages.

Motivation & Objective

  • To investigate whether programming languages like R undergo lexical evolution driven by cultural and user-driven forces, similar to natural languages.
  • To assess how changes in function usage and package adoption reflect broader patterns of language evolution within a mature, open-source programming language.
  • To evaluate the role of community-developed packages, especially the tidyverse, in reshaping R’s lexical landscape over time.
  • To examine whether programming language evolution is constrained by grammar or driven by user preferences and practical usability.
  • To explore the implications of rapid lexical change for code continuity, readability, and long-term maintainability in scientific software.

Proposed method

  • Web scraping of GitHub repositories using the GitHub API to collect all R scripts published between January 2014 and December 2021.
  • Extraction of function calls via text parsing, identifying all function names preceding an opening parenthesis '(', treating them as 1-gram linguistic units.
  • Inclusion of three common syntactic operators ('%in%', '[]', '%>%') as functional equivalents to verbs in corpus linguistics.
  • Mapping each function to its associated R package, including base R and community packages, to track usage trends.
  • Aggregation of function call frequencies across time periods to analyze shifts in lexical diversity and composition.
  • Application of linguistic and ecological frameworks to interpret patterns of lexical turnover, diversity, and innovation in R.

Experimental results

Research questions

  • RQ1Has the diversity and composition of R functions in use changed significantly over time, both across and within repositories?
  • RQ2To what extent has the use of R functions been supplemented or replaced by community-developed packages, particularly the tidyverse?
  • RQ3Are there detectable trends in function and package usage that reflect mechanisms of language evolution, such as cultural drift or selective pressure?
  • RQ4How does the adoption of new syntactic constructs—like the pipe operator '%>%'—reflect broader grammatical and lexical evolution in R?
  • RQ5To what extent do user-driven innovations in R mirror patterns observed in natural language evolution, such as lexical innovation and convergence?

Key findings

  • R experienced rapid lexical diversification between 2014 and 2021, with over 168 million function calls extracted from 5.4 million R scripts across 360,321 repositories.
  • The rise of the tidyverse ecosystem was the primary driver of lexical change, with its functions becoming the most frequently used in R, surpassing base R functions in popularity.
  • The pipe operator '%>%', initially a tidyverse innovation, saw a 12-fold increase in usage from 2014 to 2021 and was used in 20% of repositories by 2021, ranking as the fourth most popular function.
  • Over 90% of the most frequently used functions in 2021 were from community packages, indicating a shift from base R to externally developed tools.
  • The study found strong evidence of user-driven lexical evolution in R, with patterns resembling those in natural languages, including cultural convergence and selective pressure for usability.
  • Despite the stability of core grammar (e.g., function syntax with parentheses), syntactic innovations like piping emerged and spread rapidly, indicating that grammar can evolve under user demand.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.