Learn R Programming

cwhmisc (version 6.0)

pasteRound: Paste rounded values

Description

Paste rounded values

Usage

pasteRound(..., digits=16, sep=" ", collapse=NULL)

Arguments

...
list of arguments to be pasted.
digits
Integer, argument to round.
sep, collapse
Character, arguments to paste.

Value

The concatenation of formatted values

Examples

Run this code
x <- rnorm(3)
x
matrix(pasteRound("x1=", x[1], ", x2=", x[2], ", x3=", x[3], sep="",
 collapse=","),ncol=1)
matrix(pasteRound("x1=", x[1], ", x2=", x[2], ", x3=", x[3], digits=3,
 sep="$", collapse="_"),ncol=1)

Run the code above in your browser using DataLab