Рет қаралды 663
Including documentation for the functions in your R package is critical to helping end users use your package. Documenting your code can easily be done using Roxygen2. In this Code Club, Pat uses Roxygen2 syntax to help document the functions in his phylotypr R package. Along the way, he refactors the code to improve the documentation and shows some tricks to improving the utility of the documentation. Documenting code isn't the most fun part of package development, but it's really important! This episode is part of an ongoing effort to develop an R package that implements the naive Bayesian classifier.
If you want to get a physical copy of R Packages: amzn.to/43pMR8L
If you want a free, online version of R packages: r-pkgs.org/
You can find my blog post for this episode at www.riffomonas.org/code_club/....
Check out the GitHub repository at the:
* Beginning of the episode: github.com/riffomonas/phyloty...
* End of the episode: github.com/riffomonas/phyloty...
#rstats #readr #vroom #data.table #read.delim #rdp #16S #classification #classifier #microbialecology #microbiome
Support Riffomonas by becoming a Patreon member!
/ riffomonas
Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at shop.riffomonas.org/youtube to get practice problems, tips, and insights.
If you're interested in purchasing a video workshop be sure to check out riffomonas.org/workshops/
You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: www.riffomonas.org/minimalR/
General data: www.riffomonas.org/generalR/
0:00 Introduction
3:24 Separating functions into different files
7:44 Basics of documenting functions
11:18 Using markdown in documentation
18:33 Inheriting documentation for parameters from other functions
25:31 Formatting multi-paragraph text
28:00 Inserting a "Note" section
29:04 Adding hyper links to documentation
33:25 Inserting a "References" section
36:52 Re-using references across functions
38:26 Checking that package builds correctly