[Framework examples →](../)

# R data loader to generate CSV

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

This Observable Framework example demonstrates how to write an R data loader that generates a CSV file. The data loader accesses data on penguin size measurements, performs k-means clustering, then emits a CSV containing original penguin data and cluster assignments. The data loader lives in [`src/data/penguin-kmeans.csv.R`](./src/data/penguin-kmeans.csv.R).
