For each fixation in a fixation report, this function will determine the Region of Interest that contains it, if any.

getRegion(
  fixReport,
  regionList,
  noRegnum = NA,
  noReglabel = "",
  supplement = TRUE
)

Arguments

fixReport

A data.frame containing a fixation Report as may be created by fixReport(). Must contain columns xpos and ypos.

regionList

A data.frame containing regions of interest. Must have columns with region bounds labeled 'left', 'right', 'top', 'bottom'. Regions are assumed to be rectangular.

noRegnum

A region number to assign fixations not contained within any of the regions defined in regions argument. Defaults to NA. Specified value should be %in% regions$regnum.

noReglabel

The label assigned to fixations outside of any region defined in regions argument.

supplement

If TRUE, getRegion() will return a data.frame consisting of fixReport suplemented with columns regnum and reglabel. If FALSE, return a 2 column data.frame with just those two columns.

Value

A data.frame including columns regnum and reglabel.

Details

For each fixation in a fixation report, this function will find the Region of interest that contains it, if any.

Regions are assumed to be rectangular. Region bounds labeled as 'left', 'right', 'top', 'bottom'.

The value of supplement determines whether to return the region values within an enriched version of fixReport, or as a simple two column data.frame.

Author

Dave Braze <davebraze@gmail.com>