Exercises 4 - Basic Functions

Files Corresponding to Short Course Programming in R

Exercises 4 - Basic Functions

  1. Write your own absolute value function called myAbsoluteValue. There are two options for what to do with the input:

Allow the function to take in an entire vector of values by using if_else() to do your comparison.

  1. Check your function works by plugging in the values below.
3
-5
c(3, -5)
-10:10