Using Roxygen2 to document functions in an R package (CC293)

Описание к видео Using Roxygen2 to document functions in an R package (CC293)

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: https://amzn.to/43pMR8L
If you want a free, online version of R packages: https://r-pkgs.org/

You can find my blog post for this episode at https://www.riffomonas.org/code_club/....

Check out the GitHub repository at the:
* Beginning of the episode: https://github.com/riffomonas/phyloty...
* End of the episode: https://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 https://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 https://riffomonas.org/workshops/

You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: https://www.riffomonas.org/minimalR/
General data: https://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

Комментарии

Информация по комментариям в разработке