intTableConv: Convert a standard data frame to an interData object

Description Usage Arguments Details Value Note Examples

Description

The function takes a dataframe with either 4 or 5 columns and converts it to an interData object to be used for analysis in functions in this package.

Usage

1

Arguments

df

data frame with 4 columns as described in the details.

...

arguments to be passed to the as.POSIXct function for converting time data

Details

The columns of the data frame being passed to this function should be as follows:

- column 1: a vector with the 1st participant in a dyadic interaction/game

- column 2: a vector with the 2nd participant in a dyadic interaction/game

- column 3: the outcome of the interaction coded as either

> 1 if player 1 was the winner

> -1 if player 2 was the winner

> 0 if the outcome was a tie

- column 4: a vector to be coerced to the class POSIXct by the as.POSIXct function denoting the time of the interaction/game

Value

a list like object of class interData with three elements - element 1: character of players in the interactions - element 2: range of time that the data frame encompasses - element 3: data frame with the players interactions, outcome, and date

Note

Interactions where player.1 is equal to player.2 are automatically removed as no algorithm takes into account what to do when a player plays against themself.

Examples

1
2
3
4
5
6
7
# generate generic data
interactions <- data.frame (a = sample (letters [1:10], 100, T),
                            b = sample (letters [1:10], 100, T),
                            o = sample (c(-1,-1,0,1,1), 100, T),
                            d = Sys.time () + runif (100, 40, 160))
# convert to interData object
intTableConv (interactions)

nmmarquez/linHierarchy documentation built on May 23, 2019, 9:28 p.m.