As a language for statistical analysis, R has a comprehensive library of functions for generating random numbers from various statistical distributions. In this post, I want to focus on the simplest of questions: How do I generate a random number?
The answer depends on what kind of random number you want to generate. Let's illustrate by example.