R
The R library lets you write Spade blocks using familiar R patterns — reading YAML, processing data with base R or tidyverse packages, and writing results. Type annotations use R's S4 class system via simple attributes.
Prerequisites🔗
- R 4.0 or later
pakinstalled (install.packages("pak")) --spade installuses it internally to resolve and install dependencies- The Spade CLI installed (Installation guide)
Dependencies🔗
A collection declares its CRAN dependencies in a DESCRIPTION file under Imports::
Imports:
jsonlite,
yamlThere's no separate lock step to run yourself. spade install (and the equivalent cloud build step) resolves Imports: into a pkg.lock file automatically, via pak::lockfile_create(), then installs from it with pak::lockfile_install(). If your collection already has a committed pkg.lock, that exact resolution is reused instead of being regenerated -- DESCRIPTION is where you declare what you depend on, pkg.lock is the resolved, reproducible record of it.
Installation🔗
install.packages("spadelib")Quickstart
Create your first R block step by step.
Read →Types
All available Spade types in the R library.
Read →Handler Functions
Writing R handler functions with type annotations.
Read →Manifest Generation
Auto-generating block manifests from R type annotations.
Read →Examples
Complete worked examples of R blocks.
Read →