read_events: Read File as Event Table

View source: R/event_creation.R

read_eventsR Documentation

Read File as Event Table

Description

Reads a file in table format and attempts to coerce it to an event table.

Usage

read_events(file, from.col = 1, to.col = 2, sep = "", header = TRUE, ...)

Arguments

file

Name, connection, or url of the file to be read as an event table.

from.col, to.col

Names or indices of the columns containing event endpoints. Values are swapped as needed to ensure that to > or = from on all rows.

sep

Character separating values on each line of the file. If sep = "" (the default), the separator is 'white space' (that is, any combination of one or more spaces, tabs, newlines and carriage returns).

header

Logical value indicating whether the file contains column names as its first line. If FALSE, columns will be named "V" followed by the column number, unless col.names (a vector of optional column names) is provided as an additional argument.

...

Additional arguments, of the form tag = value, to be passed directly to read.table to control how the file is read.

Details

The file is read into R by calling read.table. Any of its arguments can be set by passing additional tag = value pairs. from.col and to.col are renamed to "from" and "to" as needed. Since these column names must be unique, other columns cannot also be called "from" or "to".

See Also

read.table.

events and as_events for creating event tables from existing objects.


ezwelty/linbin documentation built on April 19, 2023, 8:41 a.m.