textTable.data.frame {tablesgg}R Documentation

Create a texttable as a Simple Listing of a Data Frame

Description

Create a textTable object representing a simple listing of a data frame.

Usage

## S3 method for class 'data.frame'
textTable(x, title=character(0), subtitle=character(0), 
    foot=character(0), row.names="", na="NA", ...)

Arguments

x

A data frame.

title, subtitle, foot

Optional character vectors providing annotation for the table. May be empty (i.e., character(0), the default).

row.names

A logical scalar or a character string. If FALSE, the row names of x are not included in the table. If TRUE, the row names are included as row headers, with a row header label of "row.names". If a character string, row names are included as row headers, and if the string is not empty, it is used as the row header label.

na

Character string used to represent missing values (NAs) in the body of the table.

...

Additional arguments passed to format.data.frame.

Details

This function processes a data frame into a table that is simply a listing of the data. There is one row in the body of the table per observation in x, and one column per variable in x. There is at most one layer of row headers (depending on argument row.names), and exactly one layer of column headers (the variable names in x).

Value

An object with S3 class textTable. The body of the table will contain the values of the data frame variables, after formatting x with format(x, ...). The variable names will be used as the column header, and if row.names is not FALSE, the row names will form the row header.

Examples

data(iris, package="datasets")
ttbl <- textTable(head(iris, 10), row.names="Obs. #", 
                  title=c("The iris data", "(First 10 observations)"))
summary(ttbl)
plot(ttbl)
  

[Package tablesgg version 0.9-1 Index]