1. Learn
  2. /
  3. Courses
  4. /
  5. Defensive R Programming

Connected

Exercise

Refactoring: functions

Copying and pasting once is OK, but three times usually suggests something is wrong.

The provided code calculates an approximate 95% confidence interval for the variables x and y.

Instructions

100 XP
  • Create a function called ci(), taking a single argument called values with no default values.
  • Get the function to return the 95% confidence interval.