convert_dominance | R Documentation |
Converts displacements RFID data into a format for easy use by either the
Dominance::ADI()
or the Dominance::Sociogram()
functions included in the Dominance package for calculating average
dominance indices and drawing sociograms. Only includes individuals that
participated in at least one interaction.
convert_dominance(d)
d |
Data frame or List. Either the specific displacements data frame which is
returned as a list item from |
List of data frames to use in functions from the Dominance package. data_sheet contains all interactions: action.from/action.to represent individuals (code is matched to animal_id in the items data frame). action.from represent displacers (winners), action.to represent displacees (losers), kind.of.action is a dummy variable representing the action type (displacement). items is a data frame matching animal_ids to to the code used in the data_sheet. actions contain the one action type (displacements) and the classification and weighting (corresponds to action.from being a winner, and action.to being a loser). bytes is a dummy vector indicating that the action type "displacement" should be included in the calculation. See examples for specific application.
Dominance package and it's functions: Dominance::ADI and Dominance::Sociogram. https://cran.r-project.org/package=Dominance
# Calculate displacements d <- disp(visits(finches_lg)) # Format for use by Dominance package i <- convert_dominance(d) i <- convert_dominance(d$displacements) # Equivalent ## Not run: # Use Dominance package: library(Dominance) # Calculate the Average Dominance Index ADI(data_sheet = i$data_sheet, items = i$items, actions = i$actions, bytes = i$bytes) # Construct social network graphs Sociogram(data_sheet = i$data_sheet, items = i$items, actions = i$actions, bits = i$bytes) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.