Module 10: Building Your Own R Package
The target audience includes learners in data science and environmental analytics courses, as well as professionals interested in sustainability reporting and transportation efficiency research. By combining robust data-handling functions with clear visualization tools, Curtis allows users to generate high-quality plots and insights without needing extensive coding experience.
Key Functions
The creation of "Curtis" package will include several core functions designed for accessibility and analytical depth:
read_smartway(path)– Imports and cleans EPA SmartWay CSV files, ensuring consistent column names and data types.plot_mpg_emissions(data)– Creates static ggplot2 scatterplots of MPG versus CO₂ emissions, colored by vehicle class.rank_best_in_class(data, metric = "mpg")– Ranks and returns the most fuel-efficient vehicles in each class or model year.trim_compare(data)– Uses Plotly to generate interactive charts comparing trims or models within a class.year_over_year(data)– Visualizes changes in MPG and emissions over time using trend lines or facet grids.
Choices in the DESCRIPTION File
The fields in the DESCRIPTION file were carefully selected to make the package reproducible, lightweight, and easy to maintain:
Title and Description clearly summarize the purpose within 80-character line limits so the file remains machine-readable and compliant with CRAN standards.
Version (0.0.0.9000) follows the development convention for early-stage packages.
Authors@R lists myself, Austin Curtis, as both author and maintainer for transparent responsibility and contact.
Depends: R (>= 3.1.2) ensures compatibility with most R installations while maintaining backward flexibility.
- Imports include ggplot2, dplyr, tidyr, readr, and
plotlythe essential libraries for data wrangling, visualization, and interactivity. License: CC0 was chosen to promote open academic sharing, allowing free reuse in coursework and collaborative research.
LazyData: true enables efficient inclusion of prebuilt datasets for faster demonstrations.
URL and BugReports connect the package directly to its GitHub repository for open development and issue tracking.
GitHub Repository
The "Curtis" package source, documentation, and example scripts are hosted on GitHub: AustinTCurtis/AustinCurtis: For LIS4370
Comments
Post a Comment