Learn R Programming

genomes (version 2.16.0)

table2: Format and sort a contigency table

Description

Formats the output of table into an matrix ordered by total counts in descending order

Usage

table2(..., n = 10)

Arguments

...
one or more objects passed to table
n
number of rows to display, default 10

Value

A matrix, sorted by total counts in descending order. Any rows or columns with zero counts are also removed from the matrix.

Details

Currently limited to 1 or 2 dimensional table arrays.

See Also

table

Examples

Run this code
data(euks)
table(euks$subgroup)
table2(euks$subgroup)
## to display all rows, use NA or a large number...
table2(euks$subgroup, n=100)
# 2-d table
table2(euks$group, year(euks$released))

Run the code above in your browser using DataLab