read_eventdata: Read event data files

Description Usage Arguments Details Value Author(s)

View source: R/events.R

Description

Reads event data output files in free format

Usage

1
2
3
read_eventdata(d, col.format = "D.STC", one.a.day = TRUE,
  scrub.keds = TRUE, date.format = "%y%m%d", sep = "\t",
  header = 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

header

Whether there is a header row in d

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:

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, and C are required.

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

Value

An event data set

Author(s)

Will Lowe


conjugateprior/events documentation built on May 13, 2019, 9:56 p.m.