1
Introduction
2
Background
2.1
Assumed knowledge
3
Good R-functions recommendations
4
Ex.1 The plotCI function
4.1
The structure of a function: start with the name
4.2
The arguments
4.3
The body
4.4
Tip: do check that the inputs are as expected
4.5
Do stuff
4.6
Return outputs
4.7
Tip: put each argument on a separate line and debug in interactive mode
4.8
R-targets pipeline recommendations (Ex.2 and Ex.3)
5
Ex.2: a simple R-targets pipeline
5.1
Step 1: ensure the workspace is defined
5.2
Step 2: recommendations for
main.R
as well as
_targets.R
6
Ex.3: “Good” function-oriented programming style
AirHealth-SWS: R-targets technique, tweaking and tinkering guidebook
6
Ex.3: “Good” function-oriented programming style