I need to compare element `i` with all previous elements `i-1,i-2,...,` and `if i < i-1, i-2, ...` return 1, otherwise return 0.

```
data <- c(10.3,14.3,7.7,15.8,14.4,16.7,15.3,20.2,17.1,7.7,15.3,16.3,19.9,14.4,18.7,20.7)

```

The result of comparing should be the following.

```
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0

```

I tried to make it with 

```
as.integer(cummin(data)==data)

```

and i get 

```
1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0

```

The first elements easy to fix. But what to do with another 1 on 10 position.