change "mean <- mean(data)" to "mean <- colMeans(data)".
Merge pull request #2 from Motokiy/patch-1

change "mean <- mean(data)" to "mean <- colMeans(data)".

checked and merged this pull request. Thank you, Motokiy. 
"mean(<data.frame>)" method is removed from current R version.