Module # 2 Assignment
I have downloaded and reviewed the import instructions. Evaluate myMean Function: Initial Code: assignment2 <- c(16, 18, 14, 22, 27, 17, 19, 17, 17, 22, 20, 22) myMean <- function(assignment2) { return(sum(assignment) / length(someData)) } myMean(assignment2) Output: > myMean(assignment2) Error in myMean(assignment2) : object 'assignment' not found Corrected Code: assignment2 <- c(16, 18, 14, 22, 27, 17, 19, 17, 17, 22, 20, 22) myMean <- function(assignment2) { return(sum(assignment2) / length(assignment2)) } myMean(assignment2) Output: > myMean(assignment2) [1] 19.25 > Explanation: The provided myMean function generated an error message indicating that an object was not found when I tested it in RStudio using the vector "assignment2". This happened because the code tried to use variable names (assignment and "someData") that weren't supplied as arguments or defined within the function. Because R function...