Learn R Programming

AnalyzeTS (version 2.2)

round2str: rounded and converted to string of numbers

Description

Rounded and converted to string of numbers to the specified number of decimal places.

Usage

round2str(x, r = 12)

Arguments

x
A numeric, vector, matrix or data frame of numeric.
r
A integer indicating the number of decimal places.

Details

Unlike round function, round2str function cross-section numbers to the specified number of decimal places and then converted result to string.

Examples

Run this code
a<-rnorm(3)
a
round2str(a,r=2)
round2str(a,r=5)

Run the code above in your browser using DataLab