Random numbers are useful for all sorts of things: running lotteries, randomizing data, simulations, even playing games. R has an excellent random-number generator, which we've looked at before. Given only a single integer to start with (called a seed), it will generate an endless stream of random numbers. Well, almost: these are pseudo-random numbers. Although they look random, and satisfy objective tests for randomness, they are generated by a mathematical formula rather a "true" random process. This isn't a problem for most applications: in fact, the fact that you can regenerate the same stream of pseudo-random numbers just by using the same seed is often useful (say, to recreate a useful simulated data set). You can find out all the details about R's random number-generators (yes, plural!) in the documentation for .Random.seed.