This function raises a value x to a power a. It is useful for improving the readability of code, clearly separating the base and exponent from other aspects of an equation.

pow(x, a)

Arguments

x

A numeric vector, the base values.

a

A numeric vector, the exponents.

Value

Returns the result of raising x to the power a.

Examples

2^4
#> [1] 16
pow(2, 4)
#> [1] 16

# Sometimes it can be hard to determine
# what is being raised to a power
x <- 2 * 13^4 / 8
# This function makes it easier to tell
x <- 2 * pow(13, 4) / 8