Title: | Organising and Analysing Eye-Tracking Data |
---|---|
Description: | A set of functions for organising and analysing datasets from experiments run using 'Eyelink' eye-trackers. Organising functions help to clean and prepare eye-tracking datasets for analysis, and mark up key events such as display changes and responses made by participants. Analysing functions help to create means for a wide range of standard measures (such as 'mean fixation durations'), which can then be fed into the appropriate statistical analyses and graphing packages as necessary. |
Authors: | Hayward Godwin [aut, cre], Alexander Muhl-Richardson [ctb] |
Maintainer: | Hayward Godwin <[email protected]> |
License: | GPL-3 |
Version: | 1.0.1 |
Built: | 2024-11-28 06:43:18 UTC |
Source: | CRAN |
Analyse behavioural data
analyse.behavioural.data(bd_df, aggregation_column_list = c())
analyse.behavioural.data(bd_df, aggregation_column_list = c())
bd_df |
Behavioural data frame/table |
aggregation_column_list |
List of columns to group by |
Provides behavioural information for the experiment as a data.table.
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK organise.message.descriptives(messagereport) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport <-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME")) # SET UP TRUE RT fixationreport[,TRUE_RT:=RESPONSE_TIME-DISPLAY_START,] behaviouralData <- analyse.behavioural.data(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK organise.message.descriptives(messagereport) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport <-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME")) # SET UP TRUE RT fixationreport[,TRUE_RT:=RESPONSE_TIME-DISPLAY_START,] behaviouralData <- analyse.behavioural.data(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
Generic function for calculating means
analyse.calculate.means( fixreport_df, aggregation_column_list, output_column_expression, final_output_column_expression, spss, dvColumnName, prefixLabel = "", debug = FALSE )
analyse.calculate.means( fixreport_df, aggregation_column_list, output_column_expression, final_output_column_expression, spss, dvColumnName, prefixLabel = "", debug = FALSE )
fixreport_df |
Fixation report |
aggregation_column_list |
List of columns to group by |
output_column_expression |
Output column expression |
final_output_column_expression |
Final output column expression |
spss |
Should the function output for SPSS? |
dvColumnName |
Column name of the dependent variable |
prefixLabel |
Prefix label |
debug |
Should debug information be provided? |
A data.table ready for SPSS analyses, which is also saved to disk as a text file.
# THIS IS A UTILITY FUNCTION THAT YOU WOULD NOT NORMALLY USE YOURSELF
# THIS IS A UTILITY FUNCTION THAT YOU WOULD NOT NORMALLY USE YOURSELF
Analyse mean fixation count
analyse.fix.count( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
analyse.fix.count( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
fixreport_df |
Fixation report |
aggregation_column_list |
List of columns to group by |
spss |
Should the function save output for SPSS? |
prefixLabel |
Prefix label |
If spss is set to FALSE (which is the default), you'll get an object containing data.tables of by-trial means for fixation counts, by-trial means for particpants, and overall descriptive statistics for use when creating graphs based on your data. If spss is set to TRUE, then you'll be provided with a 'wide' version of the data for analysis in packages such as SPSS. The function will also save a copy of the for-spss file for you as well.
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) fixCounts <- analyse.fix.count(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) fixCounts <- analyse.fix.count(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
Analyse mean fixation duration
analyse.fix.duration( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
analyse.fix.duration( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
fixreport_df |
Fixation report |
aggregation_column_list |
List of columns to group by |
spss |
Should the function save output for SPSS? |
prefixLabel |
Prefix label |
If spss is set to FALSE (which is the default), you'll get an object containing data.tables of by-trial means for fixation durations, by-trial means for particpants, and overall descriptive statistics for use when creating graphs based on your data. If spss is set to TRUE, then you'll be provided with a 'wide' version of the data for analysis in packages such as SPSS. The function will also save a copy of the for-spss file for you as well.
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) fixDurs <- analyse.fix.duration(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) fixDurs <- analyse.fix.duration(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
Analyse first fixation duration
analyse.fix.first_duration( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
analyse.fix.first_duration( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
fixreport_df |
Fixation report |
aggregation_column_list |
List of columns to group by |
spss |
Should the function save output for SPSS? |
prefixLabel |
Prefix label |
If spss is set to FALSE (which is the default), you'll get an object containing data.tables of by-trial means for first fixation durations, by-trial means for particpants, and overall descriptive statistics for use when creating graphs based on your data. If spss is set to TRUE, then you'll be provided with a 'wide' version of the data for analysis in packages such as SPSS. The function will also save a copy of the for-spss file for you as well.
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) firstDurations <- analyse.fix.first_duration(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) firstDurations <- analyse.fix.first_duration(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
Analyse total fixation time
analyse.fix.totaltime( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
analyse.fix.totaltime( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
fixreport_df |
Fixation report |
aggregation_column_list |
List of columns to group by |
spss |
Should the function save output for SPSS? |
prefixLabel |
Prefix label |
If spss is set to FALSE (which is the default), you'll get an object containing data.tables of by-trial means for total fixation times, by-trial means for particpants, and overall descriptive statistics for use when creating graphs based on your data. If spss is set to TRUE, then you'll be provided with a 'wide' version of the data for analysis in packages such as SPSS. The function will also save a copy of the for-spss file for you as well.
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) fixTotaltime <- analyse.fix.totaltime(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) fixTotaltime <- analyse.fix.totaltime(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
Analyse saccade amplitude
analyse.sac.amplitude( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
analyse.sac.amplitude( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
fixreport_df |
Fixation report |
aggregation_column_list |
List of columns to group by |
spss |
Should the function save output for SPSS? |
prefixLabel |
Prefix label |
If spss is set to FALSE (which is the default), you'll get an object containing data.tables of by-trial means for sacade amplitudes, by-trial means for particpants, and overall descriptive statistics for use when creating graphs based on your data. If spss is set to TRUE, then you'll be provided with a 'wide' version of the data for analysis in packages such as SPSS. The function will also save a copy of the for-spss file for you as well.
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) amplitudes <- analyse.sac.amplitude(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) amplitudes <- analyse.sac.amplitude(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
Analyse visit count
analyse.visit.count( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
analyse.visit.count( fixreport_df, aggregation_column_list = c(), spss = FALSE, prefixLabel = "" )
fixreport_df |
Fixation report |
aggregation_column_list |
List of columns to group by |
spss |
Should the function save output for SPSS? |
prefixLabel |
Prefix label |
If spss is set to FALSE (which is the default), you'll get an object containing data.tables of by-trial means for number of visits to each object, by-trial means for particpants, and overall descriptive statistics for use when creating graphs based on your data. If spss is set to TRUE, then you'll be provided with a 'wide' version of the data for analysis in packages such as SPSS. The function will also save a copy of the for-spss file for you as well.
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) fixationreport[,CURRENT_FIX_INTEREST_AREA_RUN_ID:=1,] visitCounts <- analyse.visit.count(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
# BREAK UP BY TARGET-PRESENT AND TARGET-ABSENT TRIALS - THE COLUMN TRIALTYPE_TEXT data(fixationreport) fixationreport[,CURRENT_FIX_INTEREST_AREA_RUN_ID:=1,] visitCounts <- analyse.visit.count(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT'))
Fixation report data from a visual search experiment.
data(fixationreport)
data(fixationreport)
A data.table object.
TBA.
data(fixationreport)
data(fixationreport)
Message report data from a visual search experiment.
data(messagereport)
data(messagereport)
A data.table object.
TBA.
data(messagereport)
data(messagereport)
Save RT and Accuracy split by specified columns.
organise.behavioural.base( fixreport_df, grouping_column_list, response_period_start = "" )
organise.behavioural.base( fixreport_df, grouping_column_list, response_period_start = "" )
fixreport_df |
Fixation report. |
grouping_column_list |
List of columns to split by. |
response_period_start |
Message that starts the RT timer. |
Summarised behavioural information as a data.table.
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport<-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME")) # SET UP TRUE RT fixationreport[,TRUE_RT:=RESPONSE_TIME-DISPLAY_START,] behaviouralData <- analyse.behavioural.data(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT')) # RANDOM TRIAL TO CHECK THINGS OUT print(organise.checks.random_trial(fixationreport)) # FIX CONTINGENCIES print(organise.contingencies.descriptives(fixationreport)) # REMOVE MISSING EVENTS - HERE, TRIALS WHICH LACKED A RESPONSE messageRemovals <- organise.message.removals(fixreport_df=fixationreport, required_message_list=list("DISPLAY_CHANGE", "RESPONSE_TIME")) # LOOK AT MESSAGE REMOVALS print(messageRemovals[[1]]) # GRAB THE FIXATION REPORT WITH TRIALS REMOVED fixMessagesRemoved <- messageRemovals[[2]] # THIS SHOWS WE HAVE NO UNCLASSIFIED FIXATIONS, GOOD! print(organise.contingencies.descriptives(fixMessagesRemoved)) # GET A BEHAVIOURAL DATASET FOR ANALYSES AND SAVING ETC. behavDT<- organise.behavioural.base(fixreport_df = fixMessagesRemoved, list( 'TRIALTYPE_TEXT'), response_period_start="DISPLAY_START")
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport<-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME")) # SET UP TRUE RT fixationreport[,TRUE_RT:=RESPONSE_TIME-DISPLAY_START,] behaviouralData <- analyse.behavioural.data(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT')) # RANDOM TRIAL TO CHECK THINGS OUT print(organise.checks.random_trial(fixationreport)) # FIX CONTINGENCIES print(organise.contingencies.descriptives(fixationreport)) # REMOVE MISSING EVENTS - HERE, TRIALS WHICH LACKED A RESPONSE messageRemovals <- organise.message.removals(fixreport_df=fixationreport, required_message_list=list("DISPLAY_CHANGE", "RESPONSE_TIME")) # LOOK AT MESSAGE REMOVALS print(messageRemovals[[1]]) # GRAB THE FIXATION REPORT WITH TRIALS REMOVED fixMessagesRemoved <- messageRemovals[[2]] # THIS SHOWS WE HAVE NO UNCLASSIFIED FIXATIONS, GOOD! print(organise.contingencies.descriptives(fixMessagesRemoved)) # GET A BEHAVIOURAL DATASET FOR ANALYSES AND SAVING ETC. behavDT<- organise.behavioural.base(fixreport_df = fixMessagesRemoved, list( 'TRIALTYPE_TEXT'), response_period_start="DISPLAY_START")
Return a randomly selected trial for detailed checks.
organise.checks.random_trial(fixreport_df)
organise.checks.random_trial(fixreport_df)
fixreport_df |
object Input fixation report. |
Single trial as a data.table, which can be printed to the console for your viewing.
data(fixationreport) print(organise.checks.random_trial(fixationreport))
data(fixationreport) print(organise.checks.random_trial(fixationreport))
Descriptive statistics of fixation contingencies.
organise.contingencies.descriptives(fixreport_df)
organise.contingencies.descriptives(fixreport_df)
fixreport_df |
Fixation report. |
Output to console.
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport<-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME")) # SET UP TRUE RT fixationreport[,TRUE_RT:=RESPONSE_TIME-DISPLAY_START,] behaviouralData <- analyse.behavioural.data(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT')) # RANDOM TRIAL TO CHECK THINGS OUT print(organise.checks.random_trial(fixationreport)) # FIX CONTINGENCIES print(organise.contingencies.descriptives(fixationreport))
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport<-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME")) # SET UP TRUE RT fixationreport[,TRUE_RT:=RESPONSE_TIME-DISPLAY_START,] behaviouralData <- analyse.behavioural.data(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT')) # RANDOM TRIAL TO CHECK THINGS OUT print(organise.checks.random_trial(fixationreport)) # FIX CONTINGENCIES print(organise.contingencies.descriptives(fixationreport))
Exclude very brief and very long fixations.
organise.exclusions.fix_durations(fixreport_df, min = 60, max = 1200)
organise.exclusions.fix_durations(fixreport_df, min = 60, max = 1200)
fixreport_df |
Fixation report. |
min |
Minimum duration of fixations. |
max |
Maximum duration of fixations. |
A data.table detailing how many trials were removed from each session, plus a data.table with the cleaned fixation report.
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport<-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME")) # SET UP TRUE RT fixationreport[,TRUE_RT:=RESPONSE_TIME-DISPLAY_START,] behaviouralData <- analyse.behavioural.data(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT')) # RANDOM TRIAL TO CHECK THINGS OUT print(organise.checks.random_trial(fixationreport)) # FIX CONTINGENCIES print(organise.contingencies.descriptives(fixationreport)) # REMOVE MISSING EVENTS - HERE, TRIALS WHICH LACKED A RESPONSE messageRemovals <- organise.message.removals(fixreport_df=fixationreport, required_message_list=list("DISPLAY_CHANGE", "RESPONSE_TIME")) # LOOK AT MESSAGE REMOVALS print(messageRemovals[[1]]) # GRAB THE FIXATION REPORT WITH TRIALS REMOVED fixMessagesRemoved <- messageRemovals[[2]] # THIS SHOWS WE HAVE NO UNCLASSIFIED FIXATIONS, GOOD! print(organise.contingencies.descriptives(fixMessagesRemoved)) # GET A BEHAVIOURAL DATASET FOR ANALYSES AND SAVING ETC. behavDT<- organise.behavioural.base(fixreport_df = fixMessagesRemoved, list( 'TRIALTYPE_TEXT'), response_period_start="DISPLAY_START") # REMOVALS BASED ON FIXATION DURATIONS durationRemovals <- organise.exclusions.fix_durations(fixreport_df=fixMessagesRemoved) durationsRemoved <- durationRemovals[[1]] # FINAL DATASET WHICH CAN BE ANALYSED finalDT <- durationRemovals [[2]]
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport<-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME")) # SET UP TRUE RT fixationreport[,TRUE_RT:=RESPONSE_TIME-DISPLAY_START,] behaviouralData <- analyse.behavioural.data(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT')) # RANDOM TRIAL TO CHECK THINGS OUT print(organise.checks.random_trial(fixationreport)) # FIX CONTINGENCIES print(organise.contingencies.descriptives(fixationreport)) # REMOVE MISSING EVENTS - HERE, TRIALS WHICH LACKED A RESPONSE messageRemovals <- organise.message.removals(fixreport_df=fixationreport, required_message_list=list("DISPLAY_CHANGE", "RESPONSE_TIME")) # LOOK AT MESSAGE REMOVALS print(messageRemovals[[1]]) # GRAB THE FIXATION REPORT WITH TRIALS REMOVED fixMessagesRemoved <- messageRemovals[[2]] # THIS SHOWS WE HAVE NO UNCLASSIFIED FIXATIONS, GOOD! print(organise.contingencies.descriptives(fixMessagesRemoved)) # GET A BEHAVIOURAL DATASET FOR ANALYSES AND SAVING ETC. behavDT<- organise.behavioural.base(fixreport_df = fixMessagesRemoved, list( 'TRIALTYPE_TEXT'), response_period_start="DISPLAY_START") # REMOVALS BASED ON FIXATION DURATIONS durationRemovals <- organise.exclusions.fix_durations(fixreport_df=fixMessagesRemoved) durationsRemoved <- durationRemovals[[1]] # FINAL DATASET WHICH CAN BE ANALYSED finalDT <- durationRemovals [[2]]
Descriptive statistics for messages in message report.
organise.message.descriptives(message_df)
organise.message.descriptives(message_df)
message_df |
Message report. |
Descriptive information relating to messages in the trials which can be printed to the console.
data(messagereport) print(organise.message.descriptives(messagereport))
data(messagereport) print(organise.message.descriptives(messagereport))
Oganise and markup fixation contingencies.
organise.message.fix_contingencies(fixreport_df, ordered_message_list)
organise.message.fix_contingencies(fixreport_df, ordered_message_list)
fixreport_df |
Fixation report. |
ordered_message_list |
List of messages to markup, in temporal order at which they occurred. |
Marked-up fixation report data.table.
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport<-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME"))
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport<-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME"))
Markup trial messages.
organise.message.markup( message_df, fixreport_df, message, show_working = FALSE )
organise.message.markup( message_df, fixreport_df, message, show_working = FALSE )
message_df |
Message report |
fixreport_df |
Fixation report |
message |
The message or event you want to mark up |
show_working |
Should eyeTrackR show more detail when calculating the output? |
An updated fixation report with the message marked up into each trial. If there is a difference between the number of input and output rows, there was a problem with the joining of your data. You'll have a repeated session name or trial index.
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE")
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE")
Remove trials which fail to have all of the listed messages.
organise.message.removals(fixreport_df, required_message_list)
organise.message.removals(fixreport_df, required_message_list)
fixreport_df |
Fixation report. |
required_message_list |
List of messages required for each trial. |
A data.table detailing how many trials were removed from each session, plus a data.table with the cleaned fixation report.
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport<-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME")) # SET UP TRUE RT fixationreport[,TRUE_RT:=RESPONSE_TIME-DISPLAY_START,] behaviouralData <- analyse.behavioural.data(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT')) # RANDOM TRIAL TO CHECK THINGS OUT print(organise.checks.random_trial(fixationreport)) # FIX CONTINGENCIES print(organise.contingencies.descriptives(fixationreport)) messageRemovals <- organise.message.removals(fixreport_df=fixationreport, required_message_list=list("DISPLAY_CHANGE", "RESPONSE_TIME")) # LOOK AT MESSAGE REMOVALS print(messageRemovals[[1]]) # GRAB THE FIXATION REPORT WITH TRIALS REMOVED fixMessagesRemoved <- messageRemovals[[2]] # THIS SHOWS WE HAVE NO UNCLASSIFIED FIXATIONS, GOOD! print(organise.contingencies.descriptives(fixMessagesRemoved))
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE") # NOW MARK UP FIXATION CONTINGENCIES fixationreport<-organise.message.fix_contingencies(fixationreport, list("DISPLAY_START", "DISPLAY_CHANGE", "RESPONSE_TIME")) # SET UP TRUE RT fixationreport[,TRUE_RT:=RESPONSE_TIME-DISPLAY_START,] behaviouralData <- analyse.behavioural.data(fixationreport, aggregation_column_list = list('TRIALTYPE_TEXT')) # RANDOM TRIAL TO CHECK THINGS OUT print(organise.checks.random_trial(fixationreport)) # FIX CONTINGENCIES print(organise.contingencies.descriptives(fixationreport)) messageRemovals <- organise.message.removals(fixreport_df=fixationreport, required_message_list=list("DISPLAY_CHANGE", "RESPONSE_TIME")) # LOOK AT MESSAGE REMOVALS print(messageRemovals[[1]]) # GRAB THE FIXATION REPORT WITH TRIALS REMOVED fixMessagesRemoved <- messageRemovals[[2]] # THIS SHOWS WE HAVE NO UNCLASSIFIED FIXATIONS, GOOD! print(organise.contingencies.descriptives(fixMessagesRemoved))
Replace spaces in message report message with underscores.
organise.message.replace_spaces(message_df)
organise.message.replace_spaces(message_df)
message_df |
A message report. |
An updated message report with spaces between words replaced with underscores.
data(messagereport) messagereport <- organise.message.replace_spaces(messagereport)
data(messagereport) messagereport <- organise.message.replace_spaces(messagereport)
Return trials where a specific message is found.
organise.message.return_specific( message_df, fixreport_df, message, show_working = FALSE )
organise.message.return_specific( message_df, fixreport_df, message, show_working = FALSE )
message_df |
Message report. |
fixreport_df |
Fixation report. |
message |
The message you want to search for. |
show_working |
Should eyeTrackR show more detail when calculating the output? |
Data.table of marked up fixation report.
# HERE, 'SYNCTIME' STARTS A TRIAL data(messagereport) data(fixationreport) print(organise.message.return_specific(messagereport, fixationreport, 'DISPLAY_START'))
# HERE, 'SYNCTIME' STARTS A TRIAL data(messagereport) data(fixationreport) print(organise.message.return_specific(messagereport, fixationreport, 'DISPLAY_START'))
Mark up responses into a fixation report.
organise.responses.markup(fixreport_df, correct_answer_column)
organise.responses.markup(fixreport_df, correct_answer_column)
fixreport_df |
Fixation report |
correct_answer_column |
The column in the fixation report containing the correct button response number (1-7). |
Updated fixation report as a data.table.
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE")
data(fixationreport) data(messagereport) # REPLACE SPACES IN MESSAGES messagereport <- organise.message.replace_spaces(messagereport) # TAKE A LOOK print(organise.message.descriptives(messagereport)) # MARKUP fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_START") fixationreport <- organise.message.markup(message_df=messagereport, fixreport_df = fixationreport, message="DISPLAY_CHANGE") # NOW DO ACCURACY AND RT MARKUP fixationreport <- organise.responses.markup(fixationreport, "CORRECT_RESPONSE")