waetr hex logo

waetr: Web Accessibility Evaluation Tools in R

Overview

waetr is an R package that provides a comprehensive interface to the WAVE (Web Accessibility Evaluation) API. It enables automated accessibility testing of web pages with support for batch processing, detailed reporting, and data visualization.

Features

Installation

# Install devtools if you haven't already
install.packages("devtools")

# Install waetr from GitHub
# devtools::install_github("benjaminlistyg/waetr")
install.packages("waetr", repos = c('https://benjaminlistyg.r-universe.dev', 'https://cloud.r-project.org'))

Prerequisites

Basic Usage

Single URL Analysis

library(waetr)

# Analyze a single URL
result <- wave(
  key = "your_api_key",
  url = "https://example.com"
)

# View summary statistics
print(result$statistics)

Batch Analysis

# Analyze multiple URLs
urls <- c(
  "https://example.com",
  "https://example.org",
  "https://example.net"
)

# Generate comprehensive report
report <- create_accessibility_report(
  input = urls,
  api_key = "your_api_key",
  output_dir = "accessibility_report"
)

Visualizations

# Compare accessibility categories
compare_accessibility(
  input = urls,
  api_key = "your_api_key",
  plot_type = "category_counts"
)

# View detailed issues
compare_accessibility(
  input = urls,
  api_key = "your_api_key",
  plot_type = "issues"
)

# Compare structural elements
compare_accessibility(
  input = urls,
  api_key = "your_api_key",
  plot_type = "structure"
)

Function Documentation

Main Functions

Visualization Functions

Report Generation

The create_accessibility_report() function generates:

API Credits

The WAVE API uses a credit system:

Monitor your credit usage with:

check_wave_credits("your_api_key")

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Steps to contribute:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Running Tests

# Run all tests
devtools::test()

# Run specific test file
devtools::test(filter = "wave")

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Contact

For questions and feedback:

Citation

If you use waetr in your research, please cite it as:

Ross, B.V., & Listyg, B. (2024). waetr: R Package for Web Accessibility Evaluation Testing. 
GitHub repository: https://github.com/benjaminlistyg/waetr