title: Custom data frame in R
body: <p>I have a below data frame</p>
  <pre><code>df &lt;- data.frame(a = c(1,3,4,5,8,9), b = c(&quot;&quot;,&quot;&quot;,0,0,&quot;&quot;,&quot;&quot;))
  df$b &lt;- as.numeric(df$b)
  df
    a  b
  1 1 NA
  2 3 NA
  3 4  0
  4 5  0
  5 8 NA
  6 9 NA
  </code></pre>
  <p>Is there a way to populate the data frame that is capturing the value in column <code>a</code> only at a specific point
  Example : Expected output (a cell before 0 and after 0  in column <code>b</code> should be filled by the value in column <code>a</code>.</p>
  <pre><code>df1
    a  b
  1 1 NA
  2 3  3
  3 4  0
  4 5  0
  5 8  8
  6 9 NA
  </code></pre>