getHistory: Extract an Event History from an Arbitrary Object

Description Usage Arguments Value See Also Examples

Description

Extracts a registered event history from an arbitrary object or a specified event within that history.

Usage

1
getHistory(x, event=NULL)

Arguments

x

an object of any class.

event

a character string or integer defining a specific event to query. If no such event has been registered in a history object (or the history object does not exist) then a NA is returned. Default: NULL (do not extract a specific event).

Value

an object of class msHistory. If event is specified, only that event is returned in the history.

See Also

assignEvent, isProcessRecorded, existHistory, eventHistory.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## create a simple history 
z <- 1:5
z <- eventHistory(z, "Event A"=list(number="first", positive="yes"),
    "Event B"=list(horse="mustang"),
    "Event C"=list(string="violins and cellos", percussion="drums",
       reed="flutes and oboes"))

## extract the entire event history 
getHistory(z)

## extract only Event B (each method is 
## equivalent) 
getHistory(z,"Event B")
getHistory(z,2)
getHistory(z)["Event B"]
getHistory(z)[2]

## return entire history except the second event 
## (each method is equivalent) 
getHistory(z,-2)
getHistory(z)[-2]

## attempt to extract a non-existent event (NA is 
## returned) 
getHistory(z)["dogs"]

zeehio/msProcess documentation built on May 4, 2019, 10:15 p.m.