toBayesDF: Convert interData object to an expanded data frame

Description Usage Arguments Details Value Examples

Description

Creates a data frame which has a column for each player in a group

Usage

1
toBayesDF(intData)

Arguments

intData

object of class "interData" to build the matrix

Details

Due to the nature of construction of the data frame ties are ignored.

Value

a data frame with a row for each observation in the group and column for each player where values of 1 and -1 indicate player 1 and player 2 respectively. The outcome variable is the lat column of the data frame where 1 and 0 indicate where player 1 or player 2 won respectively.

Examples

1
2
3
4
5
6
7
8
9
# 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
id1 <- intTableConv (interactions)
# calculate using only players who had at least 1 win or loss interaction
toBayesDF (id1)

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