I have a dataframe like this

```
x <- c(1, 0, 0, 0, 2, 0, 0, 3, 0, 0, 0)
y <- c(10:20)
dat <- rbind(x, y)

```

I don't want the X row to contain 0s. Instead, I would like to replace the 0s with the value from the most recent non-zero column. 

The expected output is 

```
1    1    1    1    2    2    2    3    3     3     3
10   11   12   13   14   15   16   17   18    19    20

```

This is similar to the solution found [here](https://stackoverflow.com/questions/34785495/filling-with-previous-values), but operating column-wise rather than row-wise.

Thanks!