ANU BDSI
workshop Introduction to R programming
Biological Data Science Institute
3rd April 2024
The content in this slide will be hard for those new to programming!
Don’t give up!
formals()
: the list of input arguments,body()
: the code inside the function,environment()
: the environment (out of scope for this workshop).function()
.if
statement needs to evaluate to a single TRUE
or FALSE
ifelse()
is the vectorised version of if()
and else
statement.Whether you are good at programming or not, you will inevitably encounter errors.
If you encounter an error,
reprex
LIVE DEMO
If the question is asked in an public forum or similar:
If the problem is computer system related…
If the problem is based on data …
function()
.if
, else
, and ifelse
for conditional statements.for
loops for repetitive tasks.reprex
package.10:00
anu-bdsi.github.io/workshop-intro-to-R/