C for R users

Why R users/developers should learn some C

Author

Ella Kaye

Published

July 10, 2024

slides materials

Overview

Much of base R is written in C. As R users, we may encounter this code when debugging our own code. As R contributors, an understanding of C can enable us to find the root cause of a bug and/or propose a patch to the C code to fix a bug. In any case, learning a new programming language can be fun and rewarding! In this talk, I’ll discuss why, as R users/programmers, we may want to learn C, and resources for doing so. I’ll show examples of how C is used in the codebase of base R. I’ll give an example of how, with only a little C knowledge, it was possible to add a new feature into the R language (specifying colours with three-digit hex codes). Finally, I’ll promote the C Study Group for R contributors as a friendly community learning C together.

Event details

Event: useR! 2024

Talk listing: sched

Date: July 10th, 2024

Time: 14:15

Location: Salzburg, Austria

Key points

  • Much of base R is written in C

  • Knowing some C enables contributions to R by finding the root cause of a bug, which can then be reported and a patch proposed

  • A little knowledge of C, and R’s C API, can go a long way

Slides

Keyboard shortcuts for slideshow (once you’ve clicked inside it):

  • Use and to navigate through the slides

  • Use o for an overview of all slides

  • Use ? for an overview more keyboard shortcuts

  • Click the hamburger menu in the bottom left corner of the slide deck for more options

    • f to toggle full screen doesn’t work from this page. Go to slides and use that shortcut from there instead

Reuse

Citation

BibTeX citation:
@online{kaye2024,
  author = {Kaye, Ella},
  title = {C for {R} Users},
  date = {2024-07-10},
  url = {https://ellakaye.co.uk/talks/2024-07-10_c-for-r-users/},
  langid = {en}
}
For attribution, please cite this work as:
Kaye, Ella. 2024. “C for R Users.” July 10, 2024. https://ellakaye.co.uk/talks/2024-07-10_c-for-r-users/.