Learn R Programming

events (version 0.5)

map_codes: Aggregate event codes

Description

Aggregates event codes

Usage

map_codes(edo, fun = function(x) { return(x) })

Arguments

edo
Event data
fun
Function or list specifying the aggregation mapping

Value

Event data with new event codes

Details

This function relabels event codes according to fun, which may either be a function that returns the new name of an event when handed the old one, or a list with entries of the form: lst[[newname]] = c(oldname1, oldname2).

It can also be used as a renaming function, but it is most useful when multiple codes should be treated as equivalent.

See Also

map_actors