Assignment
I used R to test a custom function that was meant to determine a vector's mean for this assignment. The steps I took, the mistake I ran into, the cause, and how I fixed the function are all detailed here.
I tried the provided myMean method with a vector I named assignment2. The error notice "Error in sum(assignment): object 'assignment' not found" appeared when it was run. This occurred because assignment2 was the name of the function parameter, but assignment and someData, which were never specified, were used inappropriately within the function. I changed the code to use assignment2 as the parameter consistently in order to address issue. The updated version runs correctly and yields the vector's accurate mean of 19.25.


Comments
Post a Comment