Learn R Programming

events (version 0.5)

read_eventdata: Read event data files

Description

Reads event data output files in free format

Usage

read_eventdata(d, col.format = "D.STC", one.a.day = TRUE, scrub.keds = TRUE, date.format = "%y%m%d", sep = "\t", head = FALSE)

Arguments

d
Names of event data files
col.format
Format for columns in d (see details)
one.a.day
Whether to apply the duplicate event remover
scrub.keds
Whether to apply the data cleaner
date.format
How dates are represented in the orginal file
sep
File separator
head
Whether there is a header row in d

Value

An event data set

Details

Reads event data output and optionally applies the scrub_keds cleaning function and the one_a_day duplicate removal filter.

This function assumes that d is a vector of output files. These are assumed to be sep-separated text files. The column ordering is given by the col.format parameter:

  • D the date field
  • S the source actor field
  • T the target actor field
  • C the event code field
  • L the event code label field (optional)
  • Q the quote field (optional)
  • . (or anything not shown above) an ignorable column
e.g. the defaul "D.STC" format means that column 1 is the date, column 2 should be ignored, column 3 is the source, column 4 is the target, and column 5 is the event code. The optional quote and label column are not searched for.

The code plucks out just these columns, formats them appropriately and ignores everything else in the file. Only D, S, T, C, and C are required.

The format of the date field is given by format.date