[This article was first published on R – Quality and Innovation, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
This weekend I decided to create my first R package… it’s here!
https://github.com/NicoleRadziwill/easyMTS
Although I’ve been using R for 15 years, developing a package has been the one thing slightly out of reach for me. Now that I’ve been through the process once, with a package that’s not completely done (but at least has a firm foundation, and is usable to some degree), I can give you some advice:
- Make sure you know R Markdown before you begin.
- Some experience with Git and Github will be useful. Lots of experience will be very, very useful.
- Write the functions that will go into your package into a file that you can source into another R program and use. If your programs work when you run the code this way, you will have averted many problems early.
The process I used to make this happen was:
- I refactored ~250 lines of code into 15 lines of code and 12 functions. I stored the functions here: https://github.com/NicoleRadziwill/R-Functions/blob/master/MTSpak.R
- I followed this process:
- < color="red">I created an example that will become a vignette soon: < > https://qualityandinnovation.com/2019/10/13/easymts-r-package-quick-solver-for-mahalanobis-taguchi-system-mts-problems/
I hope you enjoy following along with my process, and that it helps you write packages too. If I can do it, so can you!
The post easyMTS: My First R Package (Story, and Results) appeared first on Quality and Innovation.
To leave a comment for the author, please follow the link and comment on their blog: R – Quality and Innovation.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.