I have written a function that draws random variates from a normal distribution with outliers. However I now want to take the mean of this data and append it to an empty vector 1000 times (so essentially a vector with 1000 different means using my function) Here is my attempt so so far.
M = 1000
for (i in 1:M){
means = numeric()
m = mean(rnormout(100,0,1,0,10))
means[i] = m[i]
}
However I just seem to get 1000 NAs in my means vector, any suggestions? Thanks!