In math and programming, we say that we evaluate a function when we replace the argument with a given number. So if we type sqrt(4), we evaluate the sqrt (square root) function. In R, you can evaluate a function inside another function. The evaluations happen from the inside out.

Example

The logarithm with base 2 of 16 can be calculated using the following code:

log2(16)

The absolute value of -3 can be calculated by:

abs(-3)

The logarithm with base 2 of the absolute value of -16 can be calculated by:

log2(abs(-16))

Note

The functions are evaluated from the inside out.

Exercise

Compute the logarithm with base 10 of the square root of 100. Do it with one line of code and do not make use of variables.