Skip to content

Commit

Permalink
differences for PR #624
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jun 21, 2024
1 parent 6b4889b commit 6b8ca49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions 08-making-packages-R.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
└── <other_components>
```

*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)
Expand Down
2 changes: 1 addition & 1 deletion md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6b8ca49

Please sign in to comment.