gen.evl: Generate numeric categories of events.

Description Usage Arguments Details Value Author(s) Examples

Description

Generate numeric categories of events in an idXevent list.

Usage

1
gen.evl(eventlist, null.events=NULL)

Arguments

eventlist

Either a two (2) or three (3) column matrix or data.frame. See Details.

null.events

A character vector of event values that should be treated as 0 in the eventlist. Default is NULL.

Details

For interval (or continuous) relational event models, eventlist must be a three column matrix where the first column indexes the events, the second column indexes the temporal information of when the event transpired, and the third column indexes an event history grouping factor (possibly, for instance, the name(s) of the actor(s)). For each unique value of the grouping factor, the corresponding events must be given in ascending temporal order. For ordinal (or discrete) relational event models, eventlist must be a two column matrix with the first column indexing the events and the second column indexing the event history grouping factor.

Value

A list containing:

eventlist

Vector of integers representing numeric codes for events. Has attr(,"char"), which represents the character representation of those values.

event.key

A key identifying the unique ids of each verbose event type.

null.events

if(!is.null(null.events)), a vector of null events.

Author(s)

Christopher Steven Marcum

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rawevents<-sample(rep(c("ran","eat","stay","eat","ran","play"),100))
actors<-rep(c("Jim","Bill","Pete"),10)
eventlist<-cbind(rawevents,actors)
evls<-gen.evl(eventlist)
evls$eventlist$Bill
evls$event.key

#Compare with:
evls<-gen.evl(eventlist,null.events=c("ran","eat"))
evls$eventlist$Bill
evls$event.key
evls$null.events

Example output

Loading required package: abind
Loading required package: relevent
Loading required package: trust
Loading required package: sna
Loading required package: statnet.common

Attaching package:statnet.commonThe following object is masked frompackage:base:

    order

Loading required package: network
network: Classes for Relational Data
Version 1.16.1 created on 2020-10-06.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
                    Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Martina Morris, University of Washington
                    Skye Bender-deMoll, University of Washington
 For citation information, type citation("network").
 Type help("network-package") to get started.

sna: Tools for Social Network Analysis
Version 2.6 created on 2020-10-5.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
 For citation information, type citation("sna").
 Type help(package="sna") to get started.

Loading required package: coda
relevent: Relational Event Models
Version 1.0-4 created on March 9, 2015.
copyright (c) 2007, Carter T. Butts, University of California-
Irvine
 For citation information, type citation("relevent").
 Type help(package="relevent") to get started.

informR: Sequence Statistics for Relational Event Models
Version 1.0-5 created on 2015-03-09.
copyright (c) 2010, Christopher Steven Marcum, University of California-
Irvine
 For citation information, type citation("informR").
 Type help(package="informR") to get started.

  [1] 1 3 1 2 4 1 3 3 2 1 1 2 3 1 1 2 4 2 2 2 1 1 1 1 1 3 2 1 1 4 3 2 1 1 3 2 3
 [38] 4 1 3 4 1 2 4 3 2 4 4 2 2 2 1 2 1 1 4 2 2 2 1 1 3 1 2 4 3 1 2 1 1 2 1 3 1
 [75] 1 3 4 2 2 1 4 1 3 2 4 2 2 1 2 1 2 1 1 3 4 1 3 1 1 3 4 1 1 3 4 2 4 3 1 1 1
[112] 1 4 1 1 3 1 2 4 2 1 2 4 2 1 4 1 2 1 3 2 1 4 2 4 2 3 3 2 4 1 1 1 1 3 2 1 2
[149] 4 2 2 1 3 3 2 4 1 1 4 2 2 3 4 4 2 3 3 1 1 3 2 3 4 2 1 2 2 1 2 4 2 3 1 2 1
[186] 2 4 3 2 4 2 2 2 1 4 1 4 1 4 1
attr(,"char")
  [1] "a" "c" "a" "b" "d" "a" "c" "c" "b" "a" "a" "b" "c" "a" "a" "b" "d" "b"
 [19] "b" "b" "a" "a" "a" "a" "a" "c" "b" "a" "a" "d" "c" "b" "a" "a" "c" "b"
 [37] "c" "d" "a" "c" "d" "a" "b" "d" "c" "b" "d" "d" "b" "b" "b" "a" "b" "a"
 [55] "a" "d" "b" "b" "b" "a" "a" "c" "a" "b" "d" "c" "a" "b" "a" "a" "b" "a"
 [73] "c" "a" "a" "c" "d" "b" "b" "a" "d" "a" "c" "b" "d" "b" "b" "a" "b" "a"
 [91] "b" "a" "a" "c" "d" "a" "c" "a" "a" "c" "d" "a" "a" "c" "d" "b" "d" "c"
[109] "a" "a" "a" "a" "d" "a" "a" "c" "a" "b" "d" "b" "a" "b" "d" "b" "a" "d"
[127] "a" "b" "a" "c" "b" "a" "d" "b" "d" "b" "c" "c" "b" "d" "a" "a" "a" "a"
[145] "c" "b" "a" "b" "d" "b" "b" "a" "c" "c" "b" "d" "a" "a" "d" "b" "b" "c"
[163] "d" "d" "b" "c" "c" "a" "a" "c" "b" "c" "d" "b" "a" "b" "b" "a" "b" "d"
[181] "b" "c" "a" "b" "a" "b" "d" "c" "b" "d" "b" "b" "b" "a" "d" "a" "d" "a"
[199] "d" "a"
     id  event.type
[1,] "a" "ran"     
[2,] "b" "eat"     
[3,] "c" "stay"    
[4,] "d" "play"    
  [1] 0 1 0 0 2 0 1 1 0 0 0 0 1 0 0 0 2 0 0 0 0 0 0 0 0 1 0 0 0 2 1 0 0 0 1 0 1
 [38] 2 0 1 2 0 0 2 1 0 2 2 0 0 0 0 0 0 0 2 0 0 0 0 0 1 0 0 2 1 0 0 0 0 0 0 1 0
 [75] 0 1 2 0 0 0 2 0 1 0 2 0 0 0 0 0 0 0 0 1 2 0 1 0 0 1 2 0 0 1 2 0 2 1 0 0 0
[112] 0 2 0 0 1 0 0 2 0 0 0 2 0 0 2 0 0 0 1 0 0 2 0 2 0 1 1 0 2 0 0 0 0 1 0 0 0
[149] 2 0 0 0 1 1 0 2 0 0 2 0 0 1 2 2 0 1 1 0 0 1 0 1 2 0 0 0 0 0 0 2 0 1 0 0 0
[186] 0 2 1 0 2 0 0 0 0 2 0 2 0 2 0
attr(,"char")
  [1] "a" "c" "a" "b" "d" "a" "c" "c" "b" "a" "a" "b" "c" "a" "a" "b" "d" "b"
 [19] "b" "b" "a" "a" "a" "a" "a" "c" "b" "a" "a" "d" "c" "b" "a" "a" "c" "b"
 [37] "c" "d" "a" "c" "d" "a" "b" "d" "c" "b" "d" "d" "b" "b" "b" "a" "b" "a"
 [55] "a" "d" "b" "b" "b" "a" "a" "c" "a" "b" "d" "c" "a" "b" "a" "a" "b" "a"
 [73] "c" "a" "a" "c" "d" "b" "b" "a" "d" "a" "c" "b" "d" "b" "b" "a" "b" "a"
 [91] "b" "a" "a" "c" "d" "a" "c" "a" "a" "c" "d" "a" "a" "c" "d" "b" "d" "c"
[109] "a" "a" "a" "a" "d" "a" "a" "c" "a" "b" "d" "b" "a" "b" "d" "b" "a" "d"
[127] "a" "b" "a" "c" "b" "a" "d" "b" "d" "b" "c" "c" "b" "d" "a" "a" "a" "a"
[145] "c" "b" "a" "b" "d" "b" "b" "a" "c" "c" "b" "d" "a" "a" "d" "b" "b" "c"
[163] "d" "d" "b" "c" "c" "a" "a" "c" "b" "c" "d" "b" "a" "b" "b" "a" "b" "d"
[181] "b" "c" "a" "b" "a" "b" "d" "c" "b" "d" "b" "b" "b" "a" "d" "a" "d" "a"
[199] "d" "a"
     id  event.type
[1,] "a" "ran"     
[2,] "b" "eat"     
[3,] "c" "stay"    
[4,] "d" "play"    
[1] "ran" "eat"

informR documentation built on May 1, 2019, 9:22 p.m.