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

my.table

Tabulate data, with extra rows and columns.


Description

my.table.NA tabulates a vector of values and lists NA and NaN at the beginning, if they occur. my.table.margin generates contingency table together with both margins of two factors, or of a matrix, if only one parameter is given.

Usage

my.table.NA(x, relative=FALSE)
my.table.margin(v,w)

Arguments

x

A vector, will be converted to factors.

relative

= TRUE if relative values should be returned.

v

factor or matrix.

w

factor.

Value

A contingency table.

Note

Uses table.

Author(s)

Christian W. Hoffmann <christian@echoffmann.ch>
and John Fox jfox@mcmaster.ca (my.table.margin)

Examples

x <- c(1,NA,2,5,-1:7)
  my.table.NA(x)
  f1 <- sample(1:5,100,replace=TRUE) 
  f2 <- sample(1:5,100,replace=TRUE)
  my.table.margin(f1,f2)
  my.table.margin(matrix(1:24,4))

cwhmisc

Miscellaneous Functions for Math, Plotting, Printing, Statistics, Strings, and Tools

v6.6
GPL (>= 2)
Authors
Christian W. Hoffmann
Initial release
2018-08-24, 10:40:10

We don't support your browser anymore

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