Week 4: Making an R Package Using Week 2 Functions
- Installation
- Contact
- Contributing
- What is an R package
- Key points of an R package
- My R Package
- Roadmap
- Helpful Resources
Week4RepoReal is available from GitHub
To install the development version of the package, load the following code into R studio:
if(!require(devtools))
install.packages("devtools")
if(!require(OpenSpecy))
install.packages("OpenSpecy")
devtools::install_github("hsherrod2019/Week4RepoReal")
Make sure to load the OpenSpecy package which contains the raman_hdpe.csv; the csv can also be found under the 'Data' tab on the repository
library(devtools)
library(Week4RepoReal)
library(OpenSpecy)
This package looks at the average wavenumber, average intensity, and intensity ratio of two peaks
# Calculate the average wavenumber of the raman_hdpe data set
calculate_average_wavenumber(raman_hdpe)
# Calculate the average intensity of the raman_hdpe data set
calculate_average_intensity(raman_hdpe)
# Calculate the ratio of two intensity peaks; make sure to input two values for x and y
calculate_intensity_ratio(x, y)
Here is the Open Specy webpage as a reference to how the functions for these R packages were created.
If you want to connect with me, email here
Contributions of all kinds are greatly appreciated! Contact here on how to get started
Remember to adhere to this project's Code of Conduct
An R package is a collection of functions, data, and documentation that acts like a toolkit for users to perform tasks in R studio. They are created by developers and shared with the R community.
- Functionality: Each package typically focuses on a specific area of analysis
- Installation: Need to install an R package to use it
- Loading a package: Need to load an R package once it is installed
- Function usage: After loading a package, you can use its functions to perform specific tasks
- Documentation: R packages come with documentation that explains how to use their functions and provide examples
- Community and updates: R packages are created and maintained by a community of developers and are often updated to fix bugs, add new features, etc.
Created an R package incorporating three functions that I created during the Week 2 training.
gantt
title Roadmap Practice Timeline for Week 4
dateFormat YYYY-MM-DD
section creating the R Package
Examples of other R Packages :2023-06-26, 2023-06-30
How to incorporate functions :2023-06-26, 2023-06-30
Putting R packages together :2023-06-28, 2023-07-03
section making week 4 repo
Outline of repo :2023-06-29, 2023-07-03
Including external links :2023-06-30, 2023-06-30
Format and grammar corrections :2023-06-30, 2023-07-03