Dataframe `d1`:

```
x  y
4 10
6 20
7 30

```

Dataframe `d2`:

```
x   z
3 100
6 200
9 300

```

How do I merge `d1` and `d2` by `"x"` where `d1$x` should be matched against exact match or the next higher number in `d2$x`. Output should look like:

```
x   y    z
4  10  200 # (4 is matched against next higher value that is 6)
6  20  200 # (6 is matched against 6)
7  30  300 # (7 is matched against next higher value that is 9)

```

If `merge()` cannot do this, then is there any other way to do this? For loops are painfully slow.