Hi I try to create a loop for uniform Distribution for my homework

and this is my code, when I run i get this error, "Error in do.call(c, mean_uni) :

'what' must be a function or character string

In addition: There were 50 or more warnings (use warnings() to see the first 50)"

can someone help me fix this

Uniform_Distribution = function(samples, size, min, max){

uni_size = samples

set.seed(22)

uni = list()

for (i in 1:uni_size) {

uniform_samples = runif(n = size, min, max)

uni[[i]] = uniform_samples

}

mean_uni = list()

for (j in 1:length(uni)) {

mean1 = mean(uni[j])

mean_uni[[j]] = mean1

}

means_unidistri = do.call(c,mean_uni)

means_unidistri

}

means_unidistri = Uniform_Distribution(samples = 100, size = 30, min = 0, max = 1)

means_unidistri