2
Hello! I am having trouble finding my error in the program below. I want to generate allele values from a level vector, however I want my function to return an array of generated values. My program is returning an array, but the column values are equal.
For a better understanding: I have 4 levels and want to generate 10 values for each level. My intention is to make the program return this matrix of values.
Code of the program
v = rep(0,4)
for(k in 1:length(v)){
rf = function(n,a,b,v)
{
u =runif(n,0,1)
x = (-log(u)) / (exp((b/v[k])-a))
return(matrix(x,n,length(v))
}
}
rf(10,-3,10,v=c(10,20,30,40))