Skip to contents

Use the velocity threshold algorithm from Salvucci & Goldberg (1996) to determine saccadic eye movements. Returns a summary of the saccades found per trial, including start and end coordinates, timing, duration, mean velocity, and peak velocity.

Usage

saccade_VTI(
  data,
  sample_rate = NULL,
  threshold = 150,
  min_dur = 20,
  participant_ID = "participant_ID"
)

Arguments

data

A dataframe with raw data (time, x, y, trial) for one participant

sample_rate

sample rate of the eye-tracker. If default of NULL, then it will be computed from the timestamp data and the number of samples

threshold

velocity threshold (degrees of VA / sec) to be used for identifying saccades

min_dur

minimum duration (ms) expected for saccades. This helps to avoid identification of very short saccades occurring at the boundary of velocity threshold

participant_ID

the variable that determines the participant identifier. If no column present, assumes a single participant

Value

a data frame giving the saccades found by trial

Details

It can take either single participant data or multiple participants where there is a variable for unique participant identification. The function looks for an identifier named participant_ID by default and will treat this as multiple-participant data as default, if not it is handled as single participant data, or the participant_ID needs to be specified

Examples

data <- combine_eyes(HCL)
saccade_VTI(data, participant_ID = "pNum")
#>     pNum trial sac_n start   end duration  origin_x origin_y terminal_x
#> 1    118     1     1   747   790       43  924.8913 502.8802   572.8710
#> 2    118     1     2  1183  1216       33  550.2522 797.0665   904.1434
#> 3    118     1     3  2193  2243       50 1049.3491 235.9011  1507.8226
#> 4    118     1     4  2690  2750       60 1517.8485 787.2293   972.7982
#> 5    118     1     5  3676  3733       57  947.6657 123.4475  1472.9220
#> 6    118     1     6  4223  4279       56 1517.9491 759.8224   973.0053
#> 7    118     1     7  5343  5383       40  928.6512 492.2177   551.4663
#> 8    118     1     8  6792  6826       34  524.8298 829.4756   916.6670
#> 9    118     1     9  7106  7129       23 1008.0858 598.3720  1031.5074
#> 10   118     1    10  7602  7639       37  890.4656 644.2127   524.1420
#> 11   118     1    11  9295  9335       40  573.7701 847.7756   925.2699
#> 12   118     1    12 10435 10489       54  929.5371 135.1185   618.2629
#> 13   118     1    13 10705 10738       33  590.4193 758.2291   945.4900
#> 14   118     1    14 12138 12192       54  977.1132 436.3669  1473.5748
#> 15   118     1    15 12972 13025       53 1538.2589 820.1288   980.1268
#> 16   118     2     1   366   399       33 1009.5214 634.7551  1433.6206
#> 17   118     2     2  1146  1196       50 1488.0968 803.8687  1011.9555
#> 18   118     2     3  1793  1819       26  940.0593 177.6297   931.9980
#> 19   118     2     4  1989  2029       40  899.9465 504.8037   502.1575
#> 20   118     2     5  2626  2679       53  503.8431 787.9458   927.8132
#> 21   118     2     6  3106  3129       23  951.3465 175.7282   971.6648
#> 22   118     2     7  5142  5189       47  990.5532 289.0873  1440.6756
#> 23   118     2     8  5339  5395       56 1439.0196 846.2477   520.0998
#> 24   118     2     9  6235  6285       50  891.8324 167.0562   475.0865
#> 25   118     2    10  6752  6789       37  519.1636 786.9284   939.9464
#> 26   118     2    11  7209  7255       46  989.1180 467.5686  1513.2444
#> 27   118     2    12  7635  7662       27 1513.4448 779.3846  1131.6693
#> 28   118     3     1   933   983       50 1002.7010 194.4611  1485.5097
#> 29   118     3     2  1200  1260       60 1476.1744 841.7218   499.3671
#> 30   118     3     3  1826  1866       40  504.8058 792.4104   896.1292
#> 31   118     3     4  2993  3039       46  996.6983 498.0212  1529.1658
#> 32   118     3     5  3553  3586       33 1453.7949 842.5720  1005.8556
#> 33   118     4     1   160   196       36  981.6367 811.0610  1404.6870
#> 34   118     4     2   540   583       43 1488.3788 767.7919  1037.8731
#> 35   118     4     3  1066  1120       54  932.6748 180.0326   492.1770
#> 36   118     4     4  2389  2443       54 1472.4171 833.8392   637.4518
#> 37   118     4     5  3353  3399       46  529.1758 794.9559   975.5111
#> 38   118     4     6  4156  4189       33  980.6287 176.0979  1218.9348
#> 39   118     4     7  4196  4216       20 1260.4098 660.6613  1388.2071
#> 40   118     4     8  5459  5506       47  529.8645 768.2352   845.4405
#> 41   118     4     9  6166  6216       50  988.4912 480.0328  1513.9437
#> 42   118     4    10  8009  8072       63 1482.7134 866.4826   505.3686
#> 43   118     4    11  8609  8669       60  595.8946 909.1639  1486.6987
#> 44   118     4    12  8915  8969       54 1493.1766 844.0545   946.8369
#> 45   118     5     1   169   193       24  920.7457 793.6681   665.0876
#> 46   118     5     2   436   469       33  647.7492 768.7432   907.6719
#> 47   118     5     3   766   786       20  907.0568 491.8643   820.8612
#> 48   118     5     4  1059  1113       54  600.8392 824.8404  1462.8866
#> 49   118     5     5  1666  1703       37 1495.7123 778.3008  1060.7272
#> 50   118     5     6  2606  2652       46  964.1227 348.4754  1476.4087
#> 51   118     5     7  2996  3036       40 1529.3674 791.3107  1017.8775
#> 52   118     5     8  3682  3739       57  947.3045 301.1887  1499.1632
#> 53   118     5     9  3926  3979       53 1489.7973 768.8057   957.5302
#> 54   118     6     1   323   343       20  771.3237 683.6370   950.7294
#> 55   118     6     2   577   630       53  964.7887 466.5898  1466.3880
#> 56   118     6     3  1160  1216       56 1447.6491 814.8381   544.1528
#> 57   118     6     4  1526  1580       54  549.6498 756.5507   929.6189
#> 58   118     6     5  2823  2843       20  949.0222 189.3002   933.8608
#> 59   118     6     6  3763  3819       56 1453.7815 824.7820   533.1560
#> 60   118     6     7  4286  4323       37  498.8213 790.8234   925.9516
#> 61   119     1     1   419   439       20  937.4859 596.6131   959.2361
#> 62   119     1     2   963  1009       46  926.6087 448.9321   408.7369
#> 63   119     1     3  1386  1419       33  445.2828 730.4440   774.1377
#> 64   119     1     4  1566  1586       20  821.7980 493.3183   961.6049
#> 65   119     1     5  1859  1886       27  987.8758 332.9815   982.6170
#> 66   119     1     6  2066  2102       36 1008.7884 584.3139  1449.6108
#> 67   119     1     7  3022  3089       67 1475.4953 753.0909   454.0886
#> 68   119     1     8  3292  3326       34  473.3284 717.6178   948.4116
#> 69   119     1     9  4159  4205       46  937.9460 474.0402   483.8080
#> 70   119     1    10  4655  4715       60  505.6226 779.1145  1494.9923
#> 71   119     1    11  5005  5059       54 1433.3890 760.0195   592.4676
#> 72   119     1    12  7301  7371       70  531.4111 724.3928  1471.0353
#> 73   119     1    13  7885  7941       56 1557.4926 706.1470  1031.2273
#> 74   119     1    14  8448  8488       40  940.5212 332.6466   428.2784
#> 75   119     1    15  8848  8901       53  329.9313 650.1681   961.6728
#> 76   119     1    16  9111  9148       37  915.4118 334.5176   506.0964
#> 77   119     1    17  9608  9638       30  491.3408 780.1579   878.9651
#> 78   119     1    18  9984 10024       40  913.6017 468.3063   431.8043
#> 79   119     2     1   160   196       36  930.1504 786.8685   506.3560
#> 80   119     2     2   563   626       63  507.0262 754.6377  1422.9613
#> 81   119     2     3  1086  1123       37 1536.6883 737.5674  1171.5084
#> 82   119     2     4  2969  2999       30  958.4742 287.2842   936.6324
#> 83   119     2     5  3216  3249       33  904.4740 653.2866   534.9389
#> 84   119     2     6  3563  3602       39  529.6488 744.3024   943.8313
#> 85   119     2     7  4002  4026       24  935.2114 349.1000   813.9743
#> 86   119     2     8  4216  4256       40  741.5883 472.8151   527.5179
#> 87   119     2     9  4462  4522       60  565.8551 782.8804  1449.5204
#> 88   119     3     1   187   220       33  929.6976 731.8546   491.3072
#> 89   119     3     2   667   727       60  499.3447 755.1829  1465.4223
#> 90   119     3     3  1167  1197       30 1388.1631 659.8787  1009.4100
#> 91   119     3     4  2226  2280       54 1083.8245 440.7186  1366.5362
#> 92   119     3     5  3113  3180       67 1499.9854 787.7492   475.7855
#> 93   119     3     6  3929  3993       64  448.9802 745.1622  1460.1439
#> 94   119     3     7  4989  5069       80 1359.4973 693.7878   484.6122
#> 95   119     3     8  5093  5119       26  446.2522 690.6419   394.5154
#> 96   119     3     9  5692  5742       50  451.1674 677.6303  1005.6018
#> 97   119     3    10  7135  7162       27  933.4311 313.1571   735.9905
#> 98   119     3    11  7365  7405       40  858.5582 358.8731   506.7146
#> 99   119     4     1   237   270       33  926.5049 725.0489   514.1258
#> 100  119     4     2  1390  1440       50  553.2898 758.5523  1410.9398
#> 101  119     4     3  1853  1896       43 1400.3527 761.2807   959.3316
#> 102  119     4     4  2993  3026       33  410.2407 759.6056   834.9296
#> 103  119     4     5  3256  3296       40  878.8572 486.6256   511.0056
#> 104  119     4     6  4143  4199       56  545.5005 791.4970  1429.2845
#> 105  119     4     7  5416  5479       63 1449.6049 722.3000   503.8289
#> 106  119     4     8  6066  6119       53  538.4092 777.9468  1352.3635
#> 107  119     4     9  6625  6682       57 1457.5757 735.3299   509.4560
#> 108  119     4    10  7355  7405       50  455.0061 766.4567  1029.1588
#> 109  119     4    11  7749  7769       20  962.0985 371.5052   975.0627
#> 110  119     4    12  8605  8625       20  961.2967 482.5752   946.2679
#> 111  119     5     1   214   250       36  929.7282 740.4175   495.4903
#> 112  119     5     2  1100  1160       60  562.2012 777.7919  1469.1228
#> 113  119     5     3  2193  2227       34 1623.7868 783.7612  1626.5978
#> 114  119     5     4  2397  2450       53 1624.6249 782.5055  1623.9142
#> 115  119     5     5  2470  2523       53 1626.5158 776.7604  1624.3390
#> 116  119     5     6  2720  2796       76 1575.6467 801.0315   580.4435
#> 117  119     5     7  2890  2916       26  434.0244 734.8002   448.7737
#> 118  119     5     8  3386  3453       67  487.2023 770.7846  1445.4084
#> 119  119     5     9  4503  4569       66 1305.5712 789.1685   518.6549
#> 120  119     5    10  5519  5596       77  559.5449 750.5246  1466.2904
#> 121  119     5    11  6606  6679       73 1538.5927 769.7452   531.8304
#> 122  119     5    12  7395  7429       34  561.1405 727.3658   929.0725
#> 123  119     5    13  8215  8235       20  959.0783 363.6570  1002.1730
#> 124  119     5    14  9009  9055       46  966.1764 181.1402   490.9862
#> 125  119     5    15  9565  9592       27  514.3670 682.0681   863.4544
#> 126  119     5    16 10575 10615       40  863.9232 536.9596   477.5950
#> 127  119     5    17 11755 11798       43  431.9173 762.7475   895.9795
#> 128  119     5    18 12374 12401       27  928.1233 339.4489   708.4844
#> 129  119     6     1   590   626       36  893.5909 421.1214   445.4796
#> 130  119     6     2  3053  3106       53  456.9632 729.2448  1304.1947
#> 131  119     6     3  4232  4262       30 1372.3698 735.7928  1024.0037
#> 132  119     6     4  6778  6818       40 1008.7615 446.5270  1449.8786
#> 133  119     6     5  6832  6852       20 1556.7990 621.5306  1709.8604
#> 134  119     6     6  6938  6965       27 1635.7978 766.4061  1625.8207
#> 135  119     6     7  7558  7588       30 1524.0060 686.7242  1142.0919
#> 136  119     6     8  9365  9415       50 1000.8005 293.0768  1397.7841
#> 137  119     6     9 10281 10344       63 1419.5092 783.3005   522.3444
#> 138  119     6    10 11021 11084       63  495.6926 799.3568  1323.7945
#> 139  119     6    11 11581 11644       63 1488.0635 757.2932   501.3444
#> 140  119     6    12 11994 12021       27  469.7133 707.4822   724.9794
#> 141  119     6    13 12034 12064       30  775.1127 552.5540   998.6819
#>     terminal_y mean_velocity peak_velocity
#> 1    808.04272      271.9532      395.7753
#> 2    572.85360      316.5920      453.7707
#> 3    815.95874      386.7776      625.4370
#> 4    362.66265      302.3138      469.6868
#> 5    773.01410      373.9121      676.8416
#> 6    344.40579      314.7485      528.4388
#> 7    811.74409      305.4745      450.6908
#> 8    655.82093      318.2262      433.7030
#> 9    628.36295      460.4057      812.9176
#> 10   812.66139      276.6097      385.5759
#> 11   507.11854      309.7302      482.2899
#> 12   687.51196      299.9637      550.8891
#> 13   500.89552      335.5719      483.3650
#> 14   820.45975      294.7687      432.9660
#> 15   421.15891      332.1922      555.8305
#> 16   800.74046      337.8767      533.4778
#> 17   458.93763      318.9492      498.2116
#> 18   480.38578      287.1814      412.1397
#> 19   806.82680      318.0042      479.7854
#> 20   253.97420      320.5905      509.3843
#> 21   465.01123      297.8809      535.7321
#> 22   817.47684      376.6990      686.0879
#> 23   853.99013      410.2389      646.1997
#> 24   749.27484      362.9380      583.7279
#> 25   510.38435      337.0882      479.3545
#> 26   806.21239      334.0144      496.1255
#> 27   548.60528      403.7822      626.4858
#> 28   811.01401      392.0890      704.2891
#> 29   866.36876      401.5779      668.3855
#> 30   493.93989      304.9522      498.1127
#> 31   836.79907      347.8760      522.6585
#> 32   514.52377      491.4800      940.5552
#> 33   807.59300      287.3825      541.8139
#> 34   407.89316      340.6554      549.7072
#> 35   849.41309      372.2013      682.3726
#> 36   817.06385      392.8085      562.5873
#> 37   465.23668      302.2570      451.3590
#> 38   623.21881      377.0819      638.6894
#> 39   770.51439      226.2203      292.2432
#> 40   270.38513      326.4600      500.7555
#> 41   882.37852      333.2056      522.7518
#> 42   889.74747      390.3220      594.0075
#> 43   885.09883      368.2253      499.7923
#> 44   416.29324      325.8066      519.8207
#> 45   815.40923      265.9251      344.8632
#> 46   460.19167      309.7295      547.4358
#> 47   647.49100      241.5283      265.7954
#> 48   881.41554      400.7040      551.7459
#> 49   485.14086      362.5891      579.1255
#> 50   741.68104      347.3329      581.8454
#> 51   393.74462      402.1167      560.6416
#> 52   815.85457      333.5643      677.8157
#> 53   181.31785      376.0806      501.2942
#> 54   494.17258      323.8532      437.7212
#> 55   819.45070      296.7403      452.0023
#> 56   813.94843      399.1708      565.9836
#> 57   311.93170      282.9525      419.5553
#> 58   411.30941      272.0811      352.7944
#> 59   830.62670      407.5171      590.5819
#> 60   578.07589      319.1983      476.3223
#> 61   385.89048      260.8953      343.8812
#> 62   736.63587      324.2774      434.0907
#> 63   522.73404      296.5318      410.3950
#> 64   332.33636      256.0837      426.6870
#> 65   557.67814      223.6286      327.9540
#> 66   731.04919      319.9811      429.1243
#> 67   723.96569      383.1361      491.0976
#> 68   530.82351      382.8111      588.1953
#> 69   726.20847      288.4276      374.5740
#> 70   785.48033      415.0122      528.3873
#> 71   525.59939      473.6426      742.8217
#> 72   765.71968      341.4174      457.7553
#> 73   277.11461      313.4577      436.7043
#> 74   636.55022      375.6691      498.8435
#> 75   303.23776      341.8446      621.9124
#> 76   685.16739      370.4457      452.0933
#> 77   529.08806      391.1792      552.1682
#> 78   724.13881      351.3465      460.8725
#> 79   762.26611      297.4935      426.7753
#> 80   771.04969      357.9907      445.1150
#> 81   521.52158      286.4167      397.0264
#> 82   584.14036      274.3038      406.9902
#> 83   773.08285      292.4531      498.8591
#> 84   234.80312      402.1033      593.3929
#> 85   447.56302      184.9454      226.6153
#> 86   786.49801      255.0448      324.1577
#> 87   750.54686      375.2577      507.5032
#> 88   758.72776      333.8274      429.9159
#> 89   706.53287      406.8794      550.7194
#> 90   416.62787      388.8453      489.5843
#> 91   692.01373      205.7714      292.9094
#> 92   749.79324      386.7071      502.3280
#> 93   739.73714      407.4949      537.5146
#> 94   624.15468      373.5978     1114.6777
#> 95   683.99888      463.7122     1100.2079
#> 96   446.39116      318.1697      454.1010
#> 97   401.45857      215.1896      328.6196
#> 98   760.78629      334.7032      447.7867
#> 99   746.55221      309.1610      424.0007
#> 100  760.38561      434.7216      571.3466
#> 101  585.73589      319.5020      648.2105
#> 102  477.50542      375.9011      486.5387
#> 103  735.42724      281.9654      427.4536
#> 104  725.27627      391.5986      537.3900
#> 105  750.76249      372.0435      467.7041
#> 106  565.98955      441.9099      787.5928
#> 107  768.40618      426.1481      526.9425
#> 108  449.86136      329.2294      436.9667
#> 109   87.88856      339.0770      511.8123
#> 110  279.86526      303.8552      544.9422
#> 111  735.73645      299.0414      411.5301
#> 112  745.15599      382.9806      476.5716
#> 113  781.91854      211.1565      237.3562
#> 114  780.19254      188.1241      220.3871
#> 115  796.44055      193.7084      304.8210
#> 116  621.57478      385.4126     1038.6576
#> 117  794.40469      535.3712     1213.9914
#> 118  731.99651      362.9122      500.2365
#> 119  771.84247      298.6272      383.4015
#> 120  769.89695      307.2276      425.8958
#> 121  588.35225      431.1572      632.8190
#> 122  426.38805      375.1215      498.1069
#> 123  150.70444      273.7333      373.8756
#> 124  573.53000      340.3861      509.3756
#> 125  402.05052      412.4027      531.6561
#> 126  694.73338      274.6732      385.1506
#> 127  340.18672      366.2587      592.1679
#> 128  422.20742      322.5492      453.1567
#> 129  719.21666      375.4480      457.8041
#> 130  747.38857      415.6465      490.9379
#> 131  514.08373      369.2959      456.5592
#> 132  602.33134      292.4560      343.1387
#> 133  546.70075      507.9605     1342.9012
#> 134  792.84668      230.1979      314.1205
#> 135  403.44032      400.6247      495.2271
#> 136  657.71066      284.3762      403.1224
#> 137  756.58455      353.9641      461.7777
#> 138  779.42050      329.6308      492.5720
#> 139  729.33815      392.7076      497.0189
#> 140  584.69650      264.3671      393.9167
#> 141  409.76345      246.2686      395.0241