My dataframe looks like this:

```
library(tidyverse)

df_input <- data.frame(
                   variant_id = c(1, 2, 3, 4, 5, 6),
                       August = c(0, NA, NA, NA, NA, NA),
                    September = c(0.05, NA, 0.04, 0.09, NA, NA),
                      October = c(0.05, 0.04, 0.04, 0.12, 0.25, 0.09),
                     November = c(NA, NA, NA, 0.12, NA, NA),
                     December = c(NA, 0.04, NA, 0.12, 0.09, NA),
                      January = c(NA, NA, NA, 0.12, NA, 0.09),
                     February = c(NA, NA, NA, NA, NA, NA)
                )

> df_input
  variant_id August September October November December January February
1          1     NA      0.05    0.05       NA       NA      NA       NA
2          2     NA        NA    0.04       NA     0.04      NA       NA
3          3     NA      0.04    0.04       NA       NA      NA       NA
4          4     NA      0.09    0.12     0.12     0.12    0.12       NA
5          5     NA        NA    0.25       NA     0.09      NA       NA
6          6     NA        NA    0.09       NA       NA    0.09       NA

```

I want to complete the `NA` value horizontally following these rules:

For each row:

1. Find the first non-`NA` value
2. Copy this value on the subsequent `NA` value horizontally
3. At the first non-`NA` value, switch the value to copy

For example, let's take `variant_id` = `2`.

1. The first non-`NA` value is `0.04` in the column `October`
2. Copy `0.04` in the column `November`.
3. Keep the value in the column `December` `0.04`
4. Copy `0.04` in the columns `January` and `Februrary`

For `variant_id` = `5`

1. The first non-`NA` value is `0.25` in the column `October`
2. Copy `0.25` in the column `November`
3. Then the value switch to `0.09` in December.
4. Copy `0.09` in the columns `January` and `February`

The output should be:

```
df_output <- data.frame(
                variant_id = c(1, 2, 3, 4, 5, 6),
                    August = c(0, NA, NA, NA, NA, NA),
                 September = c(0.05, NA, 0.04, 0.09, NA, NA),
                   October = c(0.05, 0.04, 0.04, 0.12, 0.25, 0.09),
                  November = c(0.05, 0.04, 0.04, 0.12, 0.25, 0.09),
                  December = c(0.05, 0.04, 0.04, 0.12, 0.09, 0.09),
                   January = c(0.05, 0.04, 0.04, 0.12, 0.09, 0.09),
                  February = c(0.05, 0.04, 0.04, 0.12, 0.09, 0.09)
             )

> df_output
  variant_id August September October November December January February
1          1      0      0.05    0.05     0.05     0.05    0.05     0.05
2          2     NA        NA    0.04     0.04     0.04    0.04     0.04
3          3     NA      0.04    0.04     0.04     0.04    0.04     0.04
4          4     NA      0.09    0.12     0.12     0.12    0.12     0.12
5          5     NA        NA    0.25     0.25     0.09    0.09     0.09
6          6     NA        NA    0.09     0.09     0.09    0.09     0.09

```

I assume I could use the functions `fill` or `complete` in `dplyr` but I don't know how to apply the function "horizontally".