Learn R Programming

netCoin (version 2.1.0)

propCoin: Express Coin Entries as Fraction of Marginal Table

Description

This is like 'prop.table' for 'coin' objects.

Usage

propCoin(x, margin= 0, decimals=1)

Value

Table like 'x' expressed relative to 'margin'.

Arguments

x

'coin' object.

margin

index, or vector of indices to generate margin for.

decimals

integer indicating the number of decimal places to be used.

Author

Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/

Examples

Run this code
## Random incidence matrix: 25 scenarios, 4 events.
I <- matrix(rbinom(100, 1, .5), nrow = 25, ncol = 4,
            dimnames = list(NULL, c("A", "B", "C", "D")))
C <- coin(I, sort = TRUE)

propCoin(C, 1)

Run the code above in your browser using DataLab