Developing Rust-powered R Packages

Learn how to develop an R package that calls Rust code with extendr

Last updated:

This guide focuses on developing R packages that call Rust code. A basic understanding of Rust and R package development is assumed. If you are new to Rust, you might find it helpful to start with our Rust Tutorials.

What’s not in this guide?

This guide is not a comprehensive introduction to Rust. It’s also not a comprehensive guide to R package development. Better resources exist for both, notably “The Book” for writing Rust and R Packages (2e) for developing R packages. For this guide, we focus on extendr-specific tools, referencing other ideas only where necessary. We will also point you to relevant external resources as needed.

Software requirements

This guide assumes the following versions of necessary software:

  • R: 4.5
  • Rust: 1.65.0
  • extendr-api: 0.9.0
  • rextendr 0.5.0

Please see the Installation Guide if you have not already installed this software.