Learn R Programming

basictabler (version 0.3.1)

qtbl: Quickly build a basic table.

Description

The qtbl function builds a basic table with one line of R.

Usage

qtbl(
  dataFrameOrMatrix,
  columnNamesAsColumnHeaders = TRUE,
  explicitColumnHeaders = NULL,
  rowNamesAsRowHeaders = FALSE,
  firstColumnAsRowHeaders = FALSE,
  explicitRowHeaders = NULL,
  columnFormats = NULL,
  theme = NULL,
  replaceExistingStyles = FALSE,
  tableStyle = NULL,
  headingStyle = NULL,
  cellStyle = NULL,
  totalStyle = NULL,
  ...
)

Arguments

dataFrameOrMatrix

The data frame or matrix containing the data to be displayed in the table.

columnNamesAsColumnHeaders

TRUE to use the data frame column names as the column headers in the table.

explicitColumnHeaders

A character vector of column headers.

rowNamesAsRowHeaders

TRUE to use the data frame row names as the row headers in the table.

firstColumnAsRowHeaders

TRUE to use the first column in the data frame as row headings.

explicitRowHeaders

A character vector of row headers.

columnFormats

A list containing format specifiers, each of which is either an sprintf() character value, a list of format() arguments or an R function that provides custom formatting logic.

theme

Either the name of a built-in theme (default, largeplain, compact or blank/none) or a list which specifies the default formatting for the table.

replaceExistingStyles

TRUE to completely replace the default styling with the specified tableStyle, headingStyle, cellStyle and/or totalStyle

tableStyle

A list of CSS style declarations that apply to the table.

headingStyle

A list of CSS style declarations that apply to the heading cells in the table.

cellStyle

A list of CSS style declarations that apply to the normal cells in the table.

totalStyle

A list of CSS style declarations that apply to the total cells in the table.

...

Additional arguments, currently compatibility and/or argumentCheckMode.

Value

A basic table.

Examples

Run this code
# NOT RUN {
qtbl(head(bhmsummary))
qtbl(bhmsummary[1:5, c("GbttWeekDate", "Origin", "Destination", "TrainCount",
  "OnTimeArrivals")])
qtbl(bhmsummary[1:5, c("GbttWeekDate", "Origin", "Destination", "TrainCount",
  "OnTimeArrivals")], columnNamesAsColumnHeaders=FALSE,
  explicitColumnHeaders=c("Week", "From", "To", "Trains", "On-Time"))

# }

Run the code above in your browser using DataLab