[R] Criteria for individually adressing data ranges within timeseries data

Alexander Holik alexander.holik at meduniwien.ac.at
Wed Oct 27 13:58:38 CEST 2010


Dear R-Users,

my dataset contains timeseries that are structured into task-specific
epochs as labelled by a factor and a boolean variable for labelling each
data-point within the series as artefact or non-artefact.

Now there's no problem in addressing continuous task-specific
time-series that are free from artefacts as long as artefacts extend to
either boundary of adjacent timeseries but how can I individually select
e.g. two time-series within each task, if valid, i.e. artefact-free data
is split by artefacts that are constricted to the middle of a task?

let me give an example;
selecting the specific non-artefact timeseries works well here:

	data	task	artefact
1	...	...	...
2	6046.9	task01	FALSE
3	6108.4	task02	FALSE
4	6123.3	task02	FALSE
5	6091.1	task02	FALSE
6	6118.4	task02	FALSE
7	6086.1	task02	FALSE
8	6090.5	task02	TRUE
9	6067.5	task02	TRUE
10	6215.9	task02	TRUE
11	6128.8	task02	TRUE
12	6136.7	task02	TRUE
13	6052.3	task03	TRUE
14	...	...	...

in which case selecting data by the criterion of task=="task02" &
artefact==FALSE would yield a valid continuous selection ranging from
line 3 to line 7 whereas in:

	data	task	artefact
1	...	...	...
2	6046.9	task01	FALSE
3	6108.4	task02	FALSE
4	6123.3	task02	FALSE
5	6091.1	task02	TRUE
6	6118.4	task02	TRUE
7	6086.1	task02	TRUE
8	6090.5	task02	TRUE
9	6067.5	task02	TRUE
10	6215.9	task02	FALSE
11	6128.8	task02	FALSE
12	6136.7	task02	FALSE
13	6052.3	task03	FALSE
14	...	...	...

the same command would select data from lines 3 to 4 and then catenate
those values with data from lines 10 to 12, producing unspecific signal
change between lines 4 and 10.

Would any of you see a straightforward approach to individually select
the artefact-free epochs from the second example?

Help would be greatly appreciated!!!

Kind regards,

Alexander Holik



More information about the R-help mailing list