Learn R Programming

blockmodeling (version 1.1.5)

formatA: A formating function for numbers

Description

Formats a vector or matrix of numbers so that all have equal length (digits). This is especially suitable for printing tables.

Usage

formatA(x, digits = 2, FUN = round, ...)

Value

A character vector or matrix.

Arguments

x

A numerical vector or matrix.

digits

The number of desired digits.

FUN

Function used for "shortening" the numbers.

...

Additional arguments to format.

Author

Aleš Žiberna

See Also

find.m, find.m2, find.cut

Examples

Run this code
A <- matrix(c(1, 1.02002, 0.2, 10.3), ncol = 2)
formatA(A)

Run the code above in your browser using DataLab