adjust_message_time: Adjusts message time based on embedded text offset
Description
Uses text in the message to adjust its time. E.g.,
for a message "-50 TARGET_ONSET"
that was sent at 105600
the actual onset occurred 50 milliseconds earlier (-50
). The function
adjusts the event timing and removes the timing offset information from
the message. I.e., the example message becomes "TARGET_ONSET"
and
its time become 105550
.
Usage
adjust_message_time(object, prefix)# S3 method for data.frame
adjust_message_time(object, prefix = "^[-+]?[:digit:]+[:space:]+")
# S3 method for eyelinkRecording
adjust_message_time(object, prefix = "^[-+]?[:digit:]+[:space:]+")
Value
Object of the same time as input, i.e., either a eyelinkRecording
object
with modified
events
slot or a data.frame with offset-adjusted events.
Arguments
- object
An eyelinkRecording
object or data.frame with events,
i.e., events
slot of the eyelinkRecording
object.
- prefix
String with a regular expression that defines the offset.
Defaults to "^[-+]?[:digit:]+[:space:]+"
(a string starts with a positive
or negative integer offset followed by a white space and the rest of the message).
Examples
Run this codedata(gaze)
# by passing events table
adjusted_events <- adjust_message_time(gaze$events)
# by passing the recording
gaze <- adjust_message_time(gaze)
Run the code above in your browser using DataLab