setRNG(setRNG)
setRNG()所属R语言包:setRNG
Set the Random Number Generator
设置随机数发生器
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Set the RNG or return information about the setting of the RNG.
设置的RNG或返回有关的设置RNG的。
用法----------Usage----------
setRNG(kind=NULL, seed=NULL, normal.kind=NULL)
参数----------Arguments----------
参数:kind
a character string.
一个字符串。
参数:seed
a vector of numbers (depending on kind).
数字向量(根据实物)。
参数:normal.kind
a character string.
一个字符串。
Details
详细信息----------Details----------
Sets the uniform and normal random number generators and the seed. The old setting is returned using invisible() in a format which can be used in another call to setRNG. (This would reset to the original value.) If no arguments are given the current setting is returned, not using invisible(). In R see RNGkind for more details.
设置统一和正常的随机数生成器的种子。旧的设置是用返回invisible()中的格式,该格式可以用在另一次调用setRNG。 (这将重置为原始值)。如果没有给出参数,返回当前设置,而不是使用invisible()。在RRNGkind更多的细节。
Note that in a function using setRNG it is good practice to assign the old setting to a variable, then reset to the old value on exiting the function (using on.exit). This avoids the possibility that overall RNG behaviour in a session, other than within your function, may be disrupted by your function.
需要注意的是在一个函数使用setRNG“”这是很好的做法,旧的设置一个变量分配,退出函数(使用on.exit),然后恢复原来的值。整体RNG行为,不是在你的函数,在一个会话中的功能可能会受到这样就避免了可能。
值----------Value----------
The old setting.
旧的设置。
副作用----------Side Effects----------
Sets global variables controlling the uniform and normal random
设置全局变量控制的统一和正常的随机
参见----------See Also----------
RNGkind, set.seed, runif, rnorm, random.number.test
RNGkind,set.seed,runif,rnorm,random.number.test
实例----------Examples----------
setRNG(kind="Wichmann-Hill", seed=c(979,1479,1542), normal.kind="Box-Muller")
rnorm(10)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|