Find Image Location in a Given Set of Locations
Description
This function determines the location of an image within a set of locations. The function accepts a vector of locations (such as "TL", "TR", "BL", "BR") and an image identifier. It returns the corresponding location name if the image is found, or βNAβ if the image is not present or is βNAβ.
Usage
find_location(locations, image)
Arguments
locations
|
A character vector representing the possible locations (e.g., βc("TL", "TR", "BL", "BR")β). |
image
|
A character value representing the image to find in the locations. |
Value
A character string representing the location of the image, or βNAβ if the image is not found or is missing.
Examples
library("webgazeR")
# Example usage of the find_location function
<- c("apple", "banana", "cherry", "date")
locations find_location(locations, "banana") # Returns "TR" if locations follow c("TL", "TR", "BL", "BR")
[1] "TR"
find_location(locations, "orange") # Returns NA
[1] NA