Session Ready
Exercise

Code evaluation

In this exercise, we will test your ability to recognize and fix the sample/solution code that doesn't adhere to the Content Guidelines.

The following guidelines are in place:

  • Sample and solution code should be between 2 and 15 lines (recommended is 10).
  • Sample and solution code must match.

The script window shows the sample code of an example exercise. In this exercise, you will be updating the sample code (script.R) to match the solution code (solution.R). When checking to see if they match, pay close attention to the defined variables, functions, function arguments, and code comments.

Note that while the sample code example here does not contain scaffolding, the exercises in your course must always include them.

Instructions 1/2
undefined XP
  • 1
    • Generate the solution with Ctrl + h.
    • Edit the variable names, function names, and function arguments so that the sample code matches the solution code exactly.
    • 2
      • Generate the solution again with Ctrl + h.
      • Edit the code comments so that the sample code matches the solution code exactly.