Module 11: Debugging in R
Upon loading in the given code example for this assignment, the first thing I attempted to do was to simply run the code and see what would happen in order to better isolate a potential issue. That gave me the error shown here:
Clearly something was amiss with the return argument, so that was the line I checked. It became obvious looking at it further that said argument shouldn't have been part of the same line as the line in brackets, so I isolated it into its own line.
Making this fix allowed the code to be properly executed, and for the function to be created. Next was testing the function with an example matrix. Initially, it failed with this error:
Resulting code can be found here: https://github.com/Retrolovania/R_Programming/blob/main/Module%2011.R
Comments
Post a Comment