Get access to all lessons in this course.
-
Setup packages
- devtools and usethis
- Package names and authors
- Choose a license
- Setup git + GitHub
-
Write code
- Writing functions
- Adding functions to our package
- Using other packages
- Packages so good they get their own functions
- Organizing .R files
-
Document
- roxygen2: In-Line Documentation for R
- Argument descriptions and examples
- Helper functions
- Joining documentation
-
Test
- Unit tests for R
- Organizing tests
- R CMD Check
- Types of Test Files
- Test Coverage
-
Teach
- Examples
- README
- Spellcheck
-
Add data and files
- Store data and files
- Include data for tests and create RMarkdown templates
- Create other templates
- Launch and store Shiny apps
- Citations, ignoring files, and including add-ins
Package Development with R
devtools and usethis
This lesson is locked
This lesson is called devtools and usethis, part of the Package Development with R course. This lesson is called devtools and usethis, part of the Package Development with R course.
Transcript
Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.
Welcome to section 1 of the course! The materials for this section are in this GitHub repo.
Your Turn
After you download or clone the materials from the GitHub repo for this section of the course, open the entire project by clicking 01_avalanchr.Rproj and then work in the exercises.Rmd file.
Load usethis and devtools if you haven’t.
Open the DESCRIPTION file and take a look. It’s very generic!
Run edit_r_profile(). Copy and paste this code into your R profile, but change it to your name and email. If you would like to add your ORCID ID see ?use_description for an example for an example that includes that.
Then, restart your R session Session > Restart R.
If you don’t want to change your R profile, you can just run the code in the console without running edit_r_profile() or restartingWhen you’ve restarted, run use_description() to replace the DESCRIPTION file.
Open the DESCRIPTION file and take a look around.
Your Turn 1 Stretch Goal
Read the help page for use_usethis(). If there are any of these that you’d like available in all interactive sessions, run the function to get the related code and add it to your R Profile.
Learn More
The best place to learn more about these packages is their websites (devtools/usethis) or the Setup chapter of the R Packages book.
You need to be signed-in to comment on this post. Login.