Creating Libraries and Packages: Difference between revisions

From Stat DS Computing Wiki
No edit summary
 
Line 1: Line 1:
[[Category:Beginner's_Guide_Software_Engineering|02]]
[[Category:Beginner's_Guide_Software|01]]


{{PackageDevelopmentSidebar}}
{{SoftwareSidebar}}


'''Package development''' is the process of organizing your research code, functions, and data into a standardized, structured format that can be easily shared, installed, and reused. While a collection of isolated scripts might suffice for exploring a local dataset, bundling your code into a formal package is essential when you want to distribute your particular algorithm or datasets for use by the general academic community
'''Package development''' is the process of organizing your research code, functions, and data into a standardized, structured format that can be easily shared, installed, and reused. While a collection of isolated scripts might suffice for exploring a local dataset, bundling your code into a formal package is essential when you want to distribute your particular algorithm or datasets for use by the general academic community

Latest revision as of 20:45, 28 June 2026


Software Development Checklist
Back to Beginner's Guide

Package development is the process of organizing your research code, functions, and data into a standardized, structured format that can be easily shared, installed, and reused. While a collection of isolated scripts might suffice for exploring a local dataset, bundling your code into a formal package is essential when you want to distribute your particular algorithm or datasets for use by the general academic community

This page connects you to our dedicated guides for the department's most commonly used languages and outlines the broader principles of distributing software.

Important: Version Control and Testing
Before diving into package development, ensure your project is tracked using Git. Creating a package also implies a commitment to reliability. You should adopt the habit of writing unit tests alongside your code to guarantee your functions perform exactly as expected—a necessity when sharing your work with the broader academic community.

1. Language-Specific Guides

The mechanics of building a package differ significantly depending on your programming language of choice. We maintain detailed, step-by-step tutorials for both R and Python.

Package Development in R
R has a deeply ingrained culture of package development. This guide covers the essential anatomy of an R package, using tools like devtools and roxygen2 to automate documentation, and best practices for organizing your statistical modeling code.

Package Development in Python
Modern Python packaging emphasizes clean project structures and declarative configuration. Learn how to structure your directories, configure a pyproject.toml file, and manage dependencies to make your machine learning models or data pipelines easily pip-installable.

2. Beyond the Code

Writing the functions is only half the battle. A successful, widely adopted package requires clear instructions and automated maintenance.

Writing Good Documentation (TBW)
Guidelines for writing clear READMEs, vignettes, and function-level docstrings. Good documentation lowers the barrier to entry and helps other researchers understand how to apply your computational tools to their own data.