adjust_message_time {eyelinkReader} | R Documentation |
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 class 'data.frame'
adjust_message_time(object, prefix = "^[-+]?[:digit:]+[:space:]+")
## S3 method for class 'eyelinkRecording'
adjust_message_time(object, prefix = "^[-+]?[:digit:]+[:space:]+")
Arguments
object |
An |
prefix |
String with a regular expression that defines the offset.
Defaults to |
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.
Examples
data(gaze)
# by passing events table
adjusted_events <- adjust_message_time(gaze$events)
# by passing the recording
gaze <- adjust_message_time(gaze)