Uniform Distribution
A uniform distribution is a probability distribution where each value in the range from a to b has an equal chance of being selected. The ‘runif()’ function is used to generate sequence of random numbers in the uniform distribution.
Syntax:
runif(n, min = 0, max = 1)
Parameter:
n= number of random samples
min=minimum value(by default 0)
max=maximum value(by default 1)
Generating Random Numbers Until Some Condition Is Met in R
R Language is mainly used for machine learning, statistics, and data analysis. Objects, functions, and R packages can easily be created by R. However we can use this language for other purposes like generating random numbers until a number greater than 0.9 is generated. We can do that using loops as R supports three kinds of loops.