Week 2

 assignment2 <- c(16, 18, 14, 22, 27, 17, 19, 17, 17, 22, 20, 22)


myMean <- function(assignment2) {

  return(sum(assignment) / length(someData))

}

myMean(assignment2)

This returns an error as there are 2 erroneous variable names assignment and someData. A corrected program sets both of these to proper names such as: 

 myMean <- function(assignment2) {

  return(sum(assignment2) / length(assignment2))

}

myMean(assignment2)


This calls to correct Variable and removes the error.

Comments

Popular posts from this blog

Assignment #10: Building Your Own R Package

Module # 7 R Object: S3 vs. S4 assignment

Week 3