Book Image

R Object-oriented Programming

By : Kelly Black
Book Image

R Object-oriented Programming

By: Kelly Black

Overview of this book

Table of Contents (19 chapters)
R Object-oriented Programming
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
4
Calculating Probabilities and Random Numbers
Package Management
Index

Overview


The base R environment has options for approximating many of the properties associated with probability distributions. This is not a complete discussion, and a more complete list can be found within the R environment using the help(Distributions) command. In this chapter, we will discuss how R can be used to approximate distribution functions, how to approximate cumulative distribution functions, how to approximate inverse cumulative distribution functions, Random Number Generation (RNG), and sampling.

The commands used for the first set of topics have a common format, and each command has the form of a prefix and a suffix. The suffix specifies the distribution by name. For example, the norm suffix refers to the normal distribution. A list of the distributions available in the base R installation is given in Table 1. The prefix is one of the following:

  • d: This determines the value of the distribution function, for example, dnorm is the height of the normal's probability distribution...