packageSkeleton


A modular data science
development framework.

Reproducible
Research

Reproducible Research

  • Reproducible research is a cornerstone of modern data science.
  • The biggest enemy of reproducible research is complexity.
  • Taming complexity requires a foundation (i.e., a framework) that provides a structure for the development of the analytic capacities providing for an easily maintained integration of the analytic tools, documentation, and content associated with the analytic tools.
  • Without a solid foundation, analytic tools often become “spaghetti code” that is barely reusable, not reproducible, and not well documented.
  • The goal of packageSkeleton is to provide a foundation for data science research that is reproducible, reusable, and well documented.

Why
packageSkeleton?

Introduction to packageSkeleton

  • packageSkeleton is a streamlined GitHub template designed to simplify R package development.
  • It also integrates with a Quarto-powered website hosted on GitHub, providing users a structured way to develop, document, and distribute their work.

Why packageSkeleton?

  • Encourages best practices in R package development
  • Provides a structure that integrates R code and documentation
  • Simplifies setting up a website for sharing your work
  • Ideal for both beginners and experienced developers

Key Features

  • R Package Template: A basic structure that you can easily customize for your package needs.
  • GitHub Integration: Fork or clone the repository and start developing right away.
  • Quarto Documentation: Create rich, dynamic content in multiple formats (e.g., HTML, PDF, DOCX, PPTX, etc.) that documents your package and provides a public-facing website.

Customizing packageSkeleton

  1. Rename the Package: Start by modifying the DESCRIPTION file and renaming the package.
  2. Add Your Own Functions: Inside the R/ directory, include your custom R functions.
  3. Generate Documentation: Use roxygen2 to create function documentation and Quarto to build your website.
  4. Deploy the Website: Publish the Quarto website using GitHub Pages.

Requirements

  • R: The latest version of R (available from CRAN)
  • Quarto: The Quarto CLI tool for building documents and websites (Install Quarto).
  • Git: Version control to manage your code and push to GitHub.
  • GitHub: Host your R package and website.

GitHub Workflow

  1. Fork the Repository: Start by forking the packageSkeleton repo from GitHub.
  2. Clone Locally: Clone the repo to your local machine using Git.
  3. Push Changes: After making your edits, push them to your GitHub repository.
  4. Deploy Website: Use GitHub Pages to host the Quarto-based documentation.

Customizing the Website

  • Quarto Configuration: Customize the _quarto.yml file to change the website settings such as title, author, and repository URL.
  • Add Pages: Create .qmd files to add custom documentation, tutorials, and more.
  • Themes & Layouts: Modify the website’s theme using CSS or choose from Quarto’s built-in themes.

Building Your Package

  • Add Functions: Use the R/ folder to store your custom R scripts and functions.
  • Generate Documentation: Write roxygen-style documentation for each function and build it using devtools::document().
  • Check Your Package: Ensure your package passes all R CMD checks by running devtools::check().

Publishing the Website

  1. Build the Website: Run quarto render to build the static HTML content.
  2. Publish on GitHub Pages: Push your changes to the repository and GitHub Pages will automatically deploy the site.
  3. Preview Locally: Use quarto preview to see live updates of the website as you edit.

Future
Directions

Future Directions

  • NextJS Integration: Integrate packageSkeleton into NextJS framework to facilitate the development of a more robust and scalable data science development framework.
  • Web API Development: Expose analytics results as web APIs to be used by users as well as other applications.
  • MCP Integration: Utilize Model Context Protocol (MCP) to expose package tools and resources for integration with popular AI services.

Conclusion

  • packageSkeleton is a powerful starting point for R package development.
  • Use it to streamline your workflow, create well-documented R code, and publish it with a professional Quarto-powered website.
  • Leverage GitHub for collaboration, version control, and public distribution of your work.

Further Resources