Skip to content

Convert tidy data into R packages with documentation websites and intelligent AI descriptions.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

openwashdata/fairenough

 
 

Repository files navigation

fairenough

Convert tidy data into R packages with documentation websites and intelligent AI descriptions. fairenough prepares your data for publication in one click.

See it in action: View example output →

Why fairenough?

Creating R data packages traditionally requires extensive manual work:

  • Writing data documentation by hand

  • Setting up package structure and files

  • Configuring websites and citations

  • Managing dependencies and validation

fairenough automates this entire workflow and optionally allows for AI-powered documentation generation.

Installation

Prerequisites: R ≥ 4.1.0 and an API key for your preferred LLM provider

# Install from GitHub
devtools::install_github("openwashdata/fairenough")

Quick Start

library(fairenough)

# 1. Set up your LLM chat object (see options below)
Sys.setenv(OPENAI_API_KEY = "your-api-key")
chat <- elmer::chat_openai(model = "gpt-4o-mini", api_args = list(temperature = 0.3))

# 2. Place your CSV/Excel files in an empty directory and run
fairenough(chat)

That’s it! You’ll get a complete R package with:

  • Documented datasets and variables

  • Professional package website

  • Citation files and README

  • Proper R package structure

LLM Provider Options

fairenough works with any ellmer chat object. Popular options:

# OpenAI (recommended for quality)
chat <- elmer::chat_openai(model = "gpt-4o-mini")

# Anthropic Claude (excellent for R code)
chat <- elmer::chat_anthropic(model = "claude-3-5-sonnet-20241022")

# Google Gemini (generous free tier)
chat <- elmer::chat_google_gemini()

# Local models via Ollama (private, free)
chat <- elmer::chat_ollama(model = "llama3.1")

See all supported providers →

Step-by-Step Usage

For more control over the process, use individual functions:

# Step 1: Initialize R package structure
setup()

# Step 2: Process your data files  
process(auto_clean = TRUE)  # Optional: basic data cleaning

# Step 3: Collect package metadata interactively
collect(extended = TRUE)    # Optional: comprehensive documentation

# Step 4: Generate AI-powered documentation
generate(chat, context = "DESCRIBE YOUR DATA")

# Step 5: Build complete package
build(overwrite = TRUE)     # Optional: update existing files

Features

Function Purpose Key Options
fairenough() Complete pipeline Accepts all wrapper function arguments
setup() Initialize R package structure Creates directories, .gitignore, etc.
process() Validate and process data files auto_clean = TRUE for basic tidying
collect() Interactive metadata collection extended = TRUE for detailed docs
generate() AI-powered documentation context = "..." for custom descriptions
build() Build package infrastructure overwrite = TRUE to update existing

Global options: All functions support verbose = TRUE and overwrite = TRUE

Supported formats: CSV, Excel (.xlsx, .xls), with automatic format detection and validation

Example Output

fairenough transforms this:

my-data/
└── penguins.csv

Into this complete R package:

  • Documentation: AI-generated variable descriptions and data dictionaries

  • Website: Professional pkgdown site ready for deployment

  • Citations: Properly formatted citation files with DOI support

  • Validation: Data structure checks and format consistency

  • Integration: Full R package that others can install and use

Getting Help

Contributing

We welcome contributions! Please see our contributing guidelines and note that this project follows conventional commits.

Development workflow:

# Test new functions
roxygen2::roxygenise(clean = TRUE)
devtools::load_all()

Architecture: Feature functions maintain consistency in supported formats and path handling. See R/utils.R for implementation details.

License

MIT


Citation: If you use fairenough in your research, please cite with:

## To cite package 'fairenough' in publications use:
## 
##   Massari N, Zhong M, Götschmann M, Walder C, Schöbitz L (2025). "fairenough: fairenough." <https://github.com/openwashdata/fairenough>.
## 
## A BibTeX entry for LaTeX users is
## 
##   @Misc{massari_etall:2025,
##     title = {fairenough: fairenough},
##     author = {Nicolo Massari and Mian Zhong and Margaux Götschmann and Colin Walder and Lars Schöbitz},
##     year = {2025},
##     url = {https://github.com/openwashdata/fairenough},
##     abstract = {Convert tidy data into R packages with documentation websites and intelligent AI descriptions.},
##     version = {0.1.0},
##   }

About

Convert tidy data into R packages with documentation websites and intelligent AI descriptions.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Languages

  • R 100.0%