Chapter 8. Doing Math and Simulations in R

image with no caption

R contains built-in functions for your favorite math operations and, of course, for statistical distributions. This chapter provides an overview of using these functions. Given the mathematical nature of this chapter, the examples assume a slightly higher-level knowledge than those in other chapters. You should be familiar with calculus and linear algebra to get the most out of these examples.

Math Functions

R includes an extensive set of built-in math functions. Here is a partial list:

  • exp(): Exponential function, base e

  • log(): Natural logarithm

  • log10(): Logarithm base 10

  • sqrt(): Square root

  • abs(): Absolute ...

Get The Art of R Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.