Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ntable

nicely formatted tables


Description

Nicely formatted tables, with row or column marginals etc.

Usage

ntable(x,y=NULL,
       percent=1,digits=2,
       row=FALSE,col=FALSE)

Arguments

x

vector or factor

y

vector of factor

percent

integer, 1 for row percentages (default), 2 for column percentages

digits

integer, digits to print after decimal place (default is 2)

row

logical, if TRUE, print row marginals

col

logical, if TRUE, print column marginals

Details

A wrapper function to prop.table that produces prettier looking results.

Value

nothing returned; the function prints the table and exits silently.

Author(s)

See Also

Examples

data(bioChemists)
attach(bioChemists)
ntable(fem)
ntable(fem,mar,row=TRUE)
ntable(fem,mar,per=2,col=TRUE)
ntable(fem,mar,per=2,row=TRUE,col=TRUE)

pscl

Political Science Computational Laboratory

v1.5.5
GPL-2
Authors
Simon Jackman, with contributions from Alex Tahk, Achim Zeileis, Christina Maimone, Jim Fearon and Zoe Meers
Initial release
2020-02-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.