Wednesday, March 20, 2024

LIS 4370 R Programming - Module 11 Assignment

In this week's assignment, we are asked to locate a bug that was deliberately placed inside a function.

The objective:

Find the bug and fix the code and discuss your debugging procedure.

Buggy code:

Fixed code:

Debugging Procedure:

To begin the debugging process, the first step was to run the code to look for any glaring errors that pop up. Upon running the code, I got the following syntax error message:

This error appears to be from the second for loop in the function, more specifically, the placement of the return statement. Currently, it is after one of the curly braces when it should be placed outside the loop. With this information in hand, all you need to do is to move the return statement to outside the loop. For better readability, it is a good idea to drop a line for each ending curly brace.

Check out the code here: Module 11 Code

~ Katie

No comments:

Post a Comment

LIS 4370 R Programming - sentimentTextAnalyzer2 Final Project

For this class's major final project, I set out to make the process of analyzing textual files and URL links for sentiment insights much...