Learn R Programming

parameters (version 0.1.0)

format_table: Dataframe and Tables Pretty Formatting

Description

Dataframe and Tables Pretty Formatting

Usage

format_table(x, sep = " | ", header = "-", digits = 2,
  protect_integers = TRUE, missing = "")

Arguments

x

A dataframe.

sep

Column separator.

header

Header separator. Can be NULL.

digits

Number of significant digits.

protect_integers

Should integers be kept as integers (i.e., without decimals)?

missing

Value by which `NA` values are replaced. By default, an empty string (i.e. "") is returned for `NA`.

Value

A data.frame in character format.

Examples

Run this code
# NOT RUN {
library(parameters)

cat(format_table(iris))
cat(format_table(iris, sep = " ", header = "*", digits = 1))
# }

Run the code above in your browser using DataLab