[Framework examples →](../)

# R data loader to generate JSON

View live: <https://observablehq.observablehq.cloud/framework-example-loader-r-to-json/>

This Observable Framework example demonstrates how to write a data loader in R that accesses text from Tolstoy’s _War and Peace_ from Project Gutenberg, does some basic text mining, then generates JSON with top word counts by book and chapter.

The data loader lives in [`src/data/tolstoy.json.R`](./src/data/tolstoy.json.R).
