Learn R Programming

informR (version 1.0-5)

gen.id: Generate Unique Id's for Events

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

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.

Value

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

Details

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

Examples

Run this code
rawevents<-sample(rep(c("ran","eat","stay","eat","ran","play"),5))
actors<-rep(c("Jim","Bill","Pete"),10)
idevents<-gen.id(rawevents)
idevents

Run the code above in your browser using DataLab