This is an internal function to generate another ones which will be effectivelly exported. This function is not exported in NAMESPACE, therefore it is not available for the end-user.

power(exponent)

Arguments

exponent

The exponent.

Value

A parent function that allows the user to create a closure that returns the n-th power of its argument.

Examples

if (FALSE) { power <- function(exponent) { function(x) { x ^ exponent } } square <- power(2) square_root <- power(.5) square(2) #4 square_root(4) #2 }