aggregate_icews
is an R function that aggregates the ICEWS data into count of within-country events based on the type of event and the actors involved. The function takes a dataframe as its sole argument and returns a dataframe.
aggregated_data = aggregate_icews(icews_data)
I've written a blog post that covers using and editing this function.