diff --git a/08-making-packages-R.md b/08-making-packages-R.md index 3a5e50f5..92768add 100644 --- a/08-making-packages-R.md +++ b/08-making-packages-R.md @@ -27,19 +27,23 @@ Why should you make your own R packages? An R package is the **basic unit of reusable code**. If you want to reuse code later or want others to be able to use your code, you should put it in a package. -An R package requires four components: +An R package requires four components, visualized in the folder tree below: -- a DESCRIPTION file with metadata about the package -- an R directory with the code -- a man directory with documentation (we will create this automatically) -- a NAMESPACE file listing user-level functions in the package (we will also create this automatically) +``` +package_name/ +├── DESCRIPTION # metadata about the package +├── man/ # function documentation (can be generated automatically) +├── NAMESPACE # list of user-level functions in the package (can be generated automatically) +├── R/ # R source code +└── +``` *There are other optional components. [rOpenSci community][r-open-sci] has written a science-focused guidebook for package development, while [the "R packages" book][r-pkgs-desc] contains all the fundamental information.* ### DESCRIPTION file ```source -Package: Package name +Package: package_name Title: Brief package description Description: Longer package description Version: Version number(major.minor.patch) diff --git a/md5sum.txt b/md5sum.txt index afb2ec4f..d73e3a24 100644 --- a/md5sum.txt +++ b/md5sum.txt @@ -10,7 +10,7 @@ "episodes/05-cmdline.Rmd" "d2f27f7392a654d640a7f9618355c039" "site/built/05-cmdline.md" "2024-06-07" "episodes/06-best-practices-R.Rmd" "2c92bd77684a9dcee63365cc4b7f6724" "site/built/06-best-practices-R.md" "2024-06-07" "episodes/07-knitr-R.Rmd" "9d72817e62024160b5b0c6a1353f236f" "site/built/07-knitr-R.md" "2024-06-04" -"episodes/08-making-packages-R.Rmd" "0086e377d3662a0ae4556dc518f7ff0a" "site/built/08-making-packages-R.md" "2024-06-04" +"episodes/08-making-packages-R.Rmd" "5e25040cf181e94adec7343547de92f6" "site/built/08-making-packages-R.md" "2024-06-21" "episodes/09-supp-intro-rstudio.Rmd" "83d1c7a48311042da41fbf464b5ea880" "site/built/09-supp-intro-rstudio.md" "2024-06-04" "episodes/10-supp-addressing-data.Rmd" "8ff2167d4fcf1223de2395ce28f5ea59" "site/built/10-supp-addressing-data.md" "2024-06-07" "episodes/11-supp-read-write-csv.Rmd" "a05e1a0dd3577863b3a99e65ccde4acc" "site/built/11-supp-read-write-csv.md" "2024-06-07"