coocur: Coocurrence matrix.

Description Usage Arguments Details Value Author(s) Examples

Description

A coocurrence object consists of a matrix with the number of ocurrences in its main diagonal and the number of coocurrences outside this diagonal. Besides, this object has two attributes: 1) n is the total of the sum of the ocurrences in each row.2) m is the sum of the maximum number of ocurrences in each row.

Usage

1
2
coocur(ocurrences, minimum = 1, maximum = Inf,
       sort = FALSE, decreasing = TRUE)

Arguments

ocurrences

an ocurrence matrix or data frame

minimum

minimum frequency to be considered

maximum

maximum frequency to be considered

sort

sort the coincidence matrix according to frequency of events

decreasing

decreasing or increasing sort of the matrix

Details

Produce a matrix of coocurrences from a matrix of occurences.

Value

An object of cooc class with a coocurrence matrix. It has two attributes:

n

Total sum of occurences)

m

Sum of maximum occurences in each row of the ocurrence matrix

Author(s)

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

Examples

1
2
3
## Tossing two coins five times.
D<-data.frame(Head=c(2,1,1,0,2),Tail=c(0,1,1,2,0))
coocur(D)

Example output

n= 10; m= 8
     Head Tail
Head    6     
Tail    2    4

netCoin documentation built on Oct. 29, 2021, 1:06 a.m.