Learn R Programming

socialh (version 0.1.1)

smatrix: Sociomatrix

Description

Function to obtain the square matrix contained dyadic frequency of dominance-related behaviors (actor and reactor).

Usage

smatrix(x)

Value

Sociomatrix

Arguments

x

Replacement or agonistic interaction data table.

Author

Julia P. S. Valente, Matheus Deniz, Karolini T. de Sousa.

Details

The fuction smatrix is only applied for data set with columns named as follows: actor and reactor. The function form a square matrix, in which the number of "n" actors is also the number of "n" reactors.

Examples

Run this code
            
x <- data.frame(actor = c(6,3,5,4,2,1,3,5,8,6,9,3,2,1,1),
               reactor = c(2,6,3,5,4,2,1,3,5,1,6,4,3,2,5))                
                                   
sociomatrix <- smatrix(x)                                                
                                                           
print(sociomatrix)

Run the code above in your browser using DataLab