square: Apply a useful power

Description Usage Arguments Details Value Examples

Description

That's it – these functions just square, cube, or take the reciprocal/inverse of a vector.

Usage

1
2
3
4
5
square(x, plot_it = FALSE)

cube(x, plot_it = FALSE)

reciprocal(x, plot_it = FALSE)

Arguments

x

The vector to be squared or cubed.

plot_it

Display a plot of x vs the output? Use logical. FALSE by default.

Details

If you really want to see more, check out the internal pow function that these functions depend on.

Value

A vector that is the:

of x.

Examples

1
2
3

STAT545-UBC-students/hw07-Mengsuper documentation built on May 3, 2019, 8:02 p.m.