gen.id: Generate Unique Id's for Events

Description Usage Arguments Details Value Author(s) Examples

Description

Internal function for generating unique single character id's for each unique event in an eventlist. May be useful for a user to call if, for some reason, event.key is lost from the eventlist.

Usage

1
gen.id(rawevents, print = TRUE)

Arguments

rawevents

a character string of events

print

logical, print the single character codes corresponding to the unique event values to stdout. Defaults to TRUE.

Details

Currently, the rawevents string must not contain more than 52 unique event types (i.e., 2Xlength(a:z)

Value

A character string of single character identifiers for each unique event.

Author(s)

Christopher Steven Marcum

Examples

1
2
3
4
rawevents<-sample(rep(c("ran","eat","stay","eat","ran","play"),5))
actors<-rep(c("Jim","Bill","Pete"),10)
idevents<-gen.id(rawevents)
idevents

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.common'

The following object is masked from 'package:base':

    order

Loading required package: network
network: Classes for Relational Data
Version 1.15 created on 2019-04-01.
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.4 created on 2016-07-23.
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.

     id  event.type
[1,] "a" "play"    
[2,] "b" "ran"     
[3,] "c" "eat"     
[4,] "d" "stay"    
 [1] "a" "a" "b" "c" "c" "a" "c" "b" "c" "b" "c" "d" "c" "d" "b" "b" "c" "b" "c"
[20] "b" "a" "b" "a" "d" "c" "d" "b" "c" "d" "b"
attr(,"event.key")
     id  event.type
[1,] "a" "play"    
[2,] "b" "ran"     
[3,] "c" "eat"     
[4,] "d" "stay"    

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