I feel this should be something easy, I have looked x the internet, but I keep getting error messages. I have done plenty of analytics in the past but am new to R and programmin
You should be using that parameter in the mean function call:
mean
columnmean <-function(y){ nc <- ncol(y) means <- numeric(nc) for(i in 1:nc) { means[i] <- mean(y[,i], na.rm = TRUE) } means }
columnmean is a custom function and does not have that parameter.
columnmean