Week 7: More on Programming and Testing
Schedule
-
8:30 - 8:50 [BB] joining explained, hw, interactive visualizations of groups shared:
-
8:50 - 9:30 [NT] programing part 2 Slides
-
9:45 - 10:00 break
- 10:00 - 11:00 [NT] testing Slides
-
11:00 - 11:30 [NT] documentation Slides
-
NEW! Quick Intro to Package Development with
devtools
Assignments (Group)
- Write a set of functions to do some data analysis, data generation or modeling that include at least one nested function
- Generate 3 automatic tests for your function
- Include documentation that will generate a help page for each function
- Post the source code on your group’s git site
Resources
coding practice
- Commentary on coding best practices
- Best Practices for Scientific Computing (Wilson et al., 2014)
- A Scientist’s Perspective on Sustainable Scientific Software. Journal of Open Research Software
testing
making packages
- Really good online book on how to make a package for distribution
- Package Development with
devtools
Cheat Sheet
asides
-
dplyr - window functions like
lead()
,lag()
,cumsum()
withgroup_by()
,filter()
,summarize()
, andmutate()
can perform many operations that you might otherwise wrap in afor
loop orapply()
function.