Sample a smooth fixation density map with a set of discrete fixations.
sample_density.density.Rd
This function samples a smooth fixation density map represented by the object x
with a set of discrete fixations provided in fix
.
Usage
# S3 method for class 'density'
sample_density(x, fix, times = NULL)
Value
A data frame with columns "z" and "time", where "z" contains the sampled density values and "time" contains the corresponding time points.
Details
The function first checks if the times
parameter is NULL. If so, it directly samples the density map using the coordinates of the fixations in the fix
argument. If the times
parameter is provided, the function first calls the sample_fixations
function to generate a new fixation sequence with the specified time points, and then samples the density map using the coordinates of the new fixation sequence. The result is a data frame containing the sampled density values and the corresponding time points.