Arnaud -
A reproducible example would be nice, but something
like this might work, assuming your data is in a file
called 'traj.txt':
dat = readLines('traj.txt')
triallines = grep('trial',dat)
starts = triallines + 2
ends = c(triallines[-1] - 1,length(dat))
thetrials = sub('# *trial *(\\d+)
Hi,
I'm trying to read some trajectory files (text files) which have the form:
# trial n
# t X Y
0 1 2
0.2 1 3
0.41.2 4
...
# trial n+1
# t X Y
0 1 2
0.2 1.3 3.3
0.4 1.5 5
...
...
where the symbol # means that the
2 matches
Mail list logo