Assignment 10
Assignment 10: Building Your Own R Package
Objectives
R Code
Purpose and Scope
Premitha’s primary goal is to streamline exploratory data analysis (EDA) for numeric data. The package provides functions that generate summary statistics and visualizations, helping users quickly understand the structure, distribution, and key characteristics of their data. Its lightweight design and minimal dependencies ensure smooth performance and compatibility across most R versions.
This package is ideal for:
-
Students learning data analysis in R
-
Researchers conducting preliminary data exploration
-
Analysts needing quick summaries of datasets
By focusing on simplicity and readability, Premitha reduces the time needed to perform routine analysis tasks while providing high-quality outputs.
Key Functions
1. quick_summary_plot()
The main function in Premitha is quick_summary_plot(). It provides a one-line summary and histogram for a numeric variable in a data frame.
Parameters:
-
data: The data frame containing the variable. -
var: The numeric variable (unquoted).
Output:
-
Prints summary statistics (minimum, 1st quartile, median, mean, 3rd quartile, maximum).
-
Displays a histogram of the variable.
Example:
Output:
The histogram generated allows users to visually inspect the distribution of the variable at a glance. Future updates will include additional functions for boxplots, correlation matrices, and automated data cleaning summaries.
DESCRIPTION File Choices
The DESCRIPTION file contains the metadata R needs to install, check, and document the package. Here’s a summary of the fields and why they were chosen:
-
Package Name:
Premitha— uniquely identifies the package. -
Title: “Simple Tools for Streamlined Data Analysis” — short and descriptive.
-
Version:
0.0.0.9000— indicates a development version. -
Authors@R:
person("Premitha", "Pagadala", email="premithapagadala@gmail.com", role=c("aut","cre"))— I am the author and maintainer. -
Description: Explains the purpose and audience of the package.
-
Depends: R (>= 3.1.2) — ensures compatibility with current R versions.
-
Imports:
ggplot2anddplyr— required for plotting and data manipulation. -
License:
CC0— allows free use and distribution. -
LazyData: True — if datasets are included in the future.
-
URL & BugReports: Links to GitHub repository and issue tracker.
-
Suggests:
knitrandrmarkdown— useful for building vignettes. -
Encoding & Roxygen: UTF-8 and markdown formatting for documentation.
Summary
The Premitha package demonstrates the essentials of R package development, including proper use of metadata in DESCRIPTION, documentation with roxygen2, and publishing on GitHub. The quick_summary_plot() function provides immediate insight into numeric variables, making it a useful tool for learning and performing exploratory data analysis.
Comments
Post a Comment