Rank and Social Hierarchy for Gregarious Animals

##Description

The “socialh” package is a set of functions developed to facilitate the establishment of the rank and social hierarchy for gregarious animals by the Si method developed by Kondo & Hurnik (1990). It is also possible to determine the number of agonistic interactions between two individuals, sociometric and dyadics matrix from dataset obtained through electronic bins.

##Function description

Function Description
replacement Identify replacements between actor and reactor from electronic bins data.
smatrix Build a square matrix contained dyadic frequency of dominance-related behaviors.
dmatrix Determine the Sij dyadic dominance relationship from a sociomatrix.
dvalue Determine the dominance value, social rank and hierarchy from Sij dyadic.
landau_index Calculate the linearity index developed by Landau (1951).
devries_index Calculate the linearity index improved by de Vries (1995).

##Application

#First, install and load the socialh R package
install.packages(socialh)
library(socialh)

# Apply the replacement(x, sec) function to create a data table with actor and reactor and save as an object to use later.
replace <- replacement (exemple.data, 14)

#Use the smatrix() function to create sociometrix by a replacemente data table and save as an object to use later.
social <- smatrix (replace)

#            actor
#  reactor   2164251 2164252 2164255 2164259 2164261 2164263
#  2164251      0      32      62      17      37      23
#  2164252     43       0      10      19       8      14
#  2164255     56      12       0       7      26      16
#  2164259     15       5      10       0       3      10
#  2164261     34       9      37       6       0      15
#  2164263     26      16      16      11       8       0

#Apply the dmatrix()function to transform the sociometrix in a dyadic matrix and save as an object to use later.

#            actor
#  reactor   2164251 2164252 2164255 2164259 2164261 2164263
#  2164251       0      -1       1       1       1      -1
#  2164252       1       0      -1       1      -1      -1
#  2164255      -1       1       0      -1      -1       0
#  2164259      -1      -1       1       0      -1      -1
#  2164261      -1       1       1       1       0       1
#  2164263       1       1       0       1      -1       0

#Employ the dvalue()function to determine dominance value, social rank and social hierarchy by a dyadic matrix.
#   dominance_value animal_id social_hierarchy social_rank
#1:       -46        2164494     subordinate     lower
#2:       -37        2164490     subordinate     lower
#3:       -36        2164482     subordinate     lower
#4:       -30        2164477     subordinate     lower
#5:       -28        2164265     subordinate     lower
#6:       -27        2164529     subordinate     lower
tail(dominance)
#   dominance_value animal_id social_hierarchy social_rank
#1:        23        2164285     dominant        high
#2:        26        2164381     dominant        high
#3:        27        2164332     dominant        high
#4:        29        2164308     dominant        high
#5:        30        2164267     dominant        high
#6:        35        2164321     dominant        high

#Apply the landau_index()function to determine the linearity index by a dyadic matrix.