It might not be random, depending upon a seed being used (usually by set.seed or RNGkind).
However, it's the best method for generating a random number within a specified range without weights. If you want weights, there are many other random number generation functions, most notably rnorm. You can find a lot more in the stats package. On Fri, Oct 29, 2021, 02:39 Ken Peng <k...@pubbox.net> wrote: > I saw runif(1) can generate a random num, is this the true random? > > > runif(1) > [1] 0.8945383 > > What's the other better method? > > Thank you. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.