Thanks to both of you for your help!
Jim, my problem is to match some observations of a time serie (vector 'a' in
my example) with theoretical predictions of this process (vector 'b' in my
example), with a small time lag between them.
--
View this message in context:
http://r.789695.n4.nabble
use the sqldf package:
> require(sqldf)
> a
time x
1 1.0 4
2 2.2 5
3 5.2 6
> b
time y
10 1
21 3
32 5
44 7
55 9
> sqldf("
+ select a.time, a.x, b.y
+ from a, b
+ where abs(a.time - b.time) < 0.5
+ ")
time x y
1 1.0 4 3
2 2.2 5 5
3 5.2 6 9
>
On Mar 12, 2011, at 4:14 PM, flymer wrote:
Dear All,
Debuting in R, I'm facing a problem.
I have 2 vectors, say 'a' et 'b', and I'd like to merge them
according to
the proximity of their variable 'time'.
How to do to keep elements which satisfy (for example) 'a$time-b
$time<0.5'?
For exa
Dear All,
Debuting in R, I'm facing a problem.
I have 2 vectors, say 'a' et 'b', and I'd like to merge them according to
the proximity of their variable 'time'.
How to do to keep elements which satisfy (for example) 'a$time-b$time<0.5'?
For example :
> a
time x
1 1.0 4
2 2.2 5
3 5.2 6
>
4 matches
Mail list logo