Random vector a with elements from the uniform distribution in R

I'm new to R and I'm looking through a book called "Discovering Statistics using R".

Although the book implies you don't need any statistical background, some of the content isn't covered/explained...

I'm wondering how you simulate a random vector a with 200 elements from the uniform distribution on the interval (-50, 50).

Maybe I'm unsure because of the terminology used. For the example I just created a vector with 200 elements that range inbetween -50 and 50... I'm just checking if this is correct.

Or is there a function that generates random values like there is in Java? I haven't found anything on google either regarding R providing random values.


runif(200, -50, 50)

会做的伎俩。

链接地址: http://www.djcxy.com/p/24820.html

上一篇: 以给定概率从正态分布抽样随机数(Matlab)

下一篇: 随机矢量a与R中均匀分布的元素