Learn R Programming

iprior (version 0.7.4)

decimal_place: Cut a numeric vector to a certain number of decimal places

Description

Cut a numeric vector to a certain number of decimal places

Usage

decimal_place(x, k = 2)

dec_plac(x, k = 2)

Value

A character vector with the correct number of decimal places.

Arguments

x

A numeric vector.

k

The number of decimal places.

Examples

Run this code
decimal_place(pi, 3)
decimal_place(c(exp(1), pi, sqrt(2)), 4)

Run the code above in your browser using DataLab