tablemerge: Create formatted tables with counts and proportions.

Description Usage Arguments Value Author(s) Examples

View source: R/tablemerge.R

Description

This function formats a frequency table as a table with counts and proportions in parentheses.

Usage

1
tablemerge(tableobject, i = 2)

Arguments

tableobject

A table or a matrix with counts.

i

Value

The function returns a string matrix with the same dimensions as the input object.

Author(s)

Joost van de Weijer

Examples

1
2
3
4
5
6
7
8
m=matrix(c(1,1,2,2),nrow=2)
tablemerge(m)
## The function is currently defined as
function (tableobject, i = 2)
{
    matrix(paste(tableobject, " (", sprintf("%.2f", prop.table(tableobject,
        i)), ")", sep = ""), nrow = dim(tableobject)[1], ncol = dim(tableobject)[2])
  }

vdweijer/supply documentation built on June 28, 2021, 7:45 a.m.