Hello,
As you know R better it will take you less and less time to get it
right, and almost surely less and less lines of code to do the same
thing. Here's a one liner:
set.seed(1510)
s=numeric(length=10)
for(i in 1:10){
pop=(rbeta(n=20,shape1=2,shape2=1))
s[i]=sum(pop)
}
set.se
I am new to R and learned to program 10 years ago in C++. I am currently
working a project that looks at the distribution of randomly generated beta
values. I take 20 random beta values find their sum, repeat 10 times.
Here is my code that it took me 4 hours to get
s=numeric(length=10)
fo
2 matches
Mail list logo