printTable: Print a Nicely Formatted Table

Description Usage Arguments Value Examples

View source: R/utility_functions.R

Description

Given a data frame, prints to console a formated table of the results.

Usage

1
printTable(tbl, return = F)

Arguments

tbl

a formatted data frame.

return

logical; if TRUE, returns the character vector with each formatted row.

Value

If return is TRUE returns the vector of character strings with the formatted output for each row of the table.

Examples

1
2
3
4
5
data( 'mtcars' )
tbl = aggregate( mtcars$mpg, mtcars[,c('cyl','vs')], mean )
tbl$x = round( tbl$x, 1 )
colnames( tbl ) = c( "# of cylinders", "Engine type", "Miles per gallon" )
printTable( tbl )

rettopnivek/utilityf documentation built on March 1, 2021, 7:05 p.m.