How and why I built {oregonfrogs}, an R package that provides datasets and tools for analyzing frog populations in Oregon.
About me
I’m an actuary and statistician with experience in public health metrics, data analysis, and reproducible research. I also develop R packages and contribute to open-source projects through organizations like Bioconductor and The R Consortium.
The problem I wanted to solve
In ecological research, high-quality datasets are crucial for studying species populations and their changes over time. However, accessing well-structured, ready-to-use datasets in R can be challenging. I wanted to create a package that simplifies data access and analysis for researchers, conservationists, and students interested in amphibian populations in Oregon.
What is I built {oregonfrogs}, an R package that provides datasets and tools for analyzing frog populations in Oregon.?
{oregonfrogs} is an R package that provides datasets on frog populations in Oregon, along with functions for basic data exploration and visualization. It helps users quickly access and analyze data without extensive preprocessing, making it a valuable tool for ecological research and environmental studies.
Tech stack
• R – The core language for data analysis and package development.
• usethis & devtools – Tools for package development and management.
• roxygen2 – For documentation and function help files.
• testthat – To implement unit testing and ensure reliability.
• ggplot2 & sf – Used for visualization and spatial analysis of frog distribution.
The process of building I built {oregonfrogs}, an R package that provides datasets and tools for analyzing frog populations in Oregon.
I started by gathering and cleaning frog population data from public sources. Once the datasets were structured, I focused on making them accessible within R, including metadata and documentation for easy use. Next, I built functions to help users explore the data and visualize population trends. Throughout the process, I ensured the package followed best practices, including version control, unit testing, and reproducible workflows.
Challenges I faced
• Data cleaning – Ensuring consistency across datasets required significant preprocessing.
• Package structure – Organizing the data and functions efficiently while keeping the package lightweight.
• Documentation – Writing clear, concise documentation to make the package user-friendly.
• CRAN submission – Navigating CRAN’s requirements and handling package dependencies.
Key learnings
• Data preparation is key – Well-structured datasets make the package more valuable.
• Testing matters – Automated tests help catch issues before release.
• Good documentation improves adoption – Clear function descriptions and examples make a huge difference.
Tips and advice
• Start simple – Focus on a core feature set before expanding.
• Use version control – Track changes with GitHub to collaborate and maintain code.
• Engage the community – Feedback from users helps improve functionality.
Final thoughts and next steps
Building {oregonfrogs} was a rewarding experience, and I plan to expand it by adding new datasets, interactive visualizations, and integration with spatial modeling tools. If you’re working with ecological data in R, I’d love to hear your feedback!