Hi there, I need a function, that calculates the mean of a desired amount of normally distributed numbers and repeats this process for a desired number of repetitions. The function should return only a single vector consisting solely of the calculated means. Also the user of this function must be able to specify the parameters of the normal distribution used while calculating the means. I need this function for the Kolmogorov Smirnov Test. I am a total beginner, so far I only have come to this point:
kolmo <- function(x, mean, sd, rep){ for(i in rep){ cat(mean(rnorm(x, mean, sd))) }} This returns a simple number, but I do need a vector to be returned. Thanks a lot in advance! [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.