Welcome to the R package development workflow workshop!
To get started, navigate to the R
folder, open the 01_gini_script.R
file, and
review the code and comments.
Once you're done, follow the instructions below:
- Turn the script in
01_gini_script.R
into a function - Document your newly created function
- Hint: Use
Code
>Insert Roxygen Skeleton
- Hint: Use
- Test your function
- Can you break it?
- How can you prevent this?
- Use defensive programming to make your function more robust
- Validate inputs
- Provide helpful error message
- Hint: Check assertthat package
- Implement unit tests
- Is your code easy to unit test?
- Do you see any potential for code re-factoring?
- Hint: Check testthat package
- Is your code well-tested?
- Hint: Use
covr::report()
from covr package
- Hint: Use