Title: | Organization Measures for Visual Foraging |
---|---|
Description: | Several functions to compute indicators for organization and efficiency in visual foraging, multi-target visual search, and cancellation tasks. The current version of this package includes the following indicators: best-r, mean Inter-target Distance, Percentage Above Optimal (PAO) scan path, and intersections in the scan path. For more detailed descriptions, see Mark et al. (2004) <doi:10.1212/01.WNL.0000131947.08670.D4>. |
Authors: | Marcos Bella-Fernández |
Maintainer: | Marcos Bella-Fernández <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-02-21 03:14:04 UTC |
Source: | https://github.com/cran/ForagingOrg |
Calculates best-r indicator from a set of x and y coordinates. Best-r is defined as the best Pearson correlation (in absolute value) between the order in which targets are collected and their respective x and y coordinates (Ólafsdóttir et al., 2021; Woods et al., 2013).
best.r(x,y)
best.r(x,y)
x |
A vector containing the x coordinates from the target locations. |
y |
A vector containing the y coordinates from the target locations. |
Returns the best-r as a numeric value.
Marcos Bella-Fernández
Ólafsdóttir, I. M., Gestdóttir, S., & Kristjánsson, Á. (2021) The development of foraging organization. Attention, Perception, & Psychophysics, 83, 2891-2904.
Woods, A. J., Göksun, T., Chatterjee, A., & Zelonis, S. (2013) The development of organized visual search. Acta Psychologica, 143, 191-199.
#Simulating target coordinates n<-20 #Number of targets collected in the simulation. X<-runif(n,0,150) #Simulating x coordinates. Y<-runif(n,0,100) #Simulating y coordinates. best.r(X,Y)
#Simulating target coordinates n<-20 #Number of targets collected in the simulation. X<-runif(n,0,150) #Simulating x coordinates. Y<-runif(n,0,100) #Simulating y coordinates. best.r(X,Y)
Every pair of consecutively collected targets are at a certain Euclidean distance, which can be calculated from their respective x and y coordinates. The mean ITD is simply the mean of all these distances (Ólafsdóttir et al., 2021; Woods et al., 2013).
meanITD(x, y)
meanITD(x, y)
x |
A vector containing the x coordinates from the target locations. |
y |
A vector containing the y coordinates from the target locations. |
A numeric value with the Mean ITD.
Marcos Bella-Fernández
Ólafsdóttir, I. M., Gestdóttir, S., & Kristjánsson, Á. (2021) The development of foraging organization. Attention, Perception, & Psychophysics, 83, 2891-2904.
Woods, A. J., Göksun, T., Chatterjee, A., & Zelonis, S. (2013) The development of organized visual search. Acta Psychologica, 143, 191-199.
#Simulating target coordinates n<-20 #Number of targets collected in the simulation. X<-runif(n,0,150) #Simulating x coordinates. Y<-runif(n,0,100) #Simulating y coordinates. meanITD(X,Y)
#Simulating target coordinates n<-20 #Number of targets collected in the simulation. X<-runif(n,0,150) #Simulating x coordinates. Y<-runif(n,0,100) #Simulating y coordinates. meanITD(X,Y)
This function counts the number and rate of intersections between non-consecutive targets in a scanpath.
number.intersections(x, y)
number.intersections(x, y)
x |
A vector with the x coordinates of the targets collected in a foraging task. |
y |
A vector with the y coordinates of the targets collected in a foraging task. |
The number of intersections between non-consecutives scanpaths in a foraging task is taken as a foraging organization measure (Ólafsdóttir et al., 2021; Woods et al., 2013). Here we developed an algorithm based on function analysis and Bolzano's Theorem (e. g. Apostol, 1974) to calculate the number of intersections.
A numeric value with the number of intersections in a scanpath.
Marcos Bella-Fernández
Apostol, T. M. (1974) Mathematical Analysis (2nd Edition). Addison Wesley Longman.
Ólafsdóttir, I. M., Gestdóttir, S., & Kristjánsson, Á. (2021) The development of foraging organization. Attention, Perception, & Psychophysics, 83, 2891-2904.
Woods, A. J., Göksun, T., Chatterjee, A., & Zelonis, S. (2013) The development of organized visual search. Acta Psychologica, 143, 191-199.
The function calculates the PAO (Ólafsdóttir et al., 2021) based on the actual scanpath trough targets and the optimal path, the shortest Hamiltonian path between the targets locations.
PAO(x, y)
PAO(x, y)
x |
A vector containing the x coordinates of the locations of the collected targets. |
y |
A vector containing the y coordinates of the locations of the collected targets. |
The function estimates the Shortest Hamiltonian path among the locations of the targets collected. This shortest Hamiltonian path is the shortest (optimal) path which passes through the locations of all targets collected. The function also calculates the actual pathlength taking into account the order in which the targets were collected. The difference between the actual and the optimal paths is expressed in terms of a percentage: 0%\ above optimal correspond to the optimal path, 100%\ bove optimal path is the double of the optimal, and so forth.
To calculate the shortest Hamiltonian path, this functions uses two other functions: TSP from TSP (Hashler & Hornik, 2021) package, and order_tsp from PairViz package (Harley & Oldford, 2022).
A numeric value with the Percentag Above Optimal path.
Marcos Bella-Fernández
Hahsler, M., and Hornik, K. (2021). TSP: Traveling Salesperson Problem (TSP). R package version 1.1-11. https://CRAN.R-project.org/package=TSP.
Hurley, C. B., and Oldford, R. W. (2022). PairViz: Visualization using Graph Traversal. R package version 1.3.5. https://CRAN.R-project.org/package=PairViz
Ólafsdóttir, I. M., Gestdóttir, S., & Kristjánsson, Á. (2021) The development of foraging organization. Attention, Perception, & Psychophysics, 83, 2891-2904.
Q score is an indicator of visual search efficiency which accounts for speed and accuracy (Geldmacher & Hills, 1997).
Q.score(n.collected.targets,n.total.targets,rt)
Q.score(n.collected.targets,n.total.targets,rt)
n.collected.targets |
A numeric value with the number of targets collected in a trial. |
n.total.targets |
A numeric value with the total number of targets present in a trial. |
rt |
A numeric value with the total time spent on a display or patch. |
A numeric value with the Q score.
Marcos Bella-Fernández
Geldmacher, D. S. & Hills, E. C. (1997) Effect of stimulus number, target-to-distractor ratio, and motor speed visual spatial search quality following traumatic brain injury. Brain Injury, 11(1), 59-66.