For each fixation in a fixation report, this function will determine the nearest Point of Interest and the fixation's distance from that Point of Interest.

nearestPOI(fixReport, poiList, supplement = TRUE)

Arguments

fixReport

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

poiList

A data.frame containing x,y coordinates for Points of Interest. The data.frame must contain exactly two columns, named xpos and ypos, in that order.

supplement

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

Value

A data.frame including columns nearestpoi and dist2poi.

Details

For each fixation in a fixation report, this function will determine the nearest Point of Interest and the fixation's distance from that Point of Interest.

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

Author

Dave Braze <davebraze@gmail.com>