Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualize pkg structure as tree #624

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions episodes/08-making-packages-R.Rmd
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
Loading