Declutter {Dark}R Documentation

Declutter

Description

A function to remove multiple button presses, i.e. data that has multiple values for the same threshold.

Usage

Declutter(tmp, delta)

Arguments

tmp

a 'dark' object with at least two elements; tmp$time and tmp$thrs.

delta

The minimum time in seconds between responses. Thresholds set within two seconds of each other are discarded apart from the first threshold.

Details

In early data collected with analogue equipment it was psossible for a subject to return multiple button presses when setting just one threshold. This data is characterised by clusters of points within a very short time. This function removes the exptra presses. It is rarely need for data collected from digital equipment.

Value

Returns an object with the same elements as 'tmp' but with object$time and object$thrs altered.

Author(s)

Jeremiah MF Kelly

Faculty of Life Sciences, The University of Manchester, M13 9PL, UK

Examples

set.seed(123)
Time  <-c(0, 0.02, 1, 2,  3, 3.02,  5, 6, 6.02, 7, 9, 9.02, 11, 
12, 12.02, 13, 15, 15.02, 16, 18, 18.02, 20) 
# with duplicated times
set.seed(1234)
tmp <- TestData(Time, sse=0.05) 
## Not run: plot(tmp$time, tmp$thrs, ylim=c(-4,0))
tmp <- Declutter(tmp)
## Not run: points(tmp$time, tmp$thrs, col='red', pch=16)


[Package Dark version 0.9.8 Index]