title: Exchange empty cells for the number 0 in R
body: <p>How do I exchange empty cells for the number 0 in my database below. I know it is possible to do: <code>df1[df1==&quot;&quot;]&lt;-0</code>, in this case it checks all columns in my database, however I would like it to be checked from the column <code>DR01</code>. I thought of something like this:
  <code>df1 %&gt;% select(starts_with(&quot;DR0&quot;)==&quot;&quot;)&lt;-0</code>, but it didn't work.</p>
  <pre><code>df1 &lt;- structure(
    list(Date = c(&quot;30-06-2021&quot;,&quot;01-07-2021&quot;,&quot;02-07-2021&quot;,&quot;03-07-2021&quot;),
         DR1 = c(4,1,4,1),
         DR01 = c(4,1,4,2), DR02= c(4,2,6,2),DR03= c(9,5,4,2),
         DR04 = c(5,4,3,3),DR05 = c(5,4,5,&quot;&quot;),
         DR06 = c(2,4,3,&quot;&quot;),DR07 = c(2,5,4,&quot;&quot;),
         DR08 = c(0,0,0,&quot;&quot;),DR09 = c(0,0,0,&quot;&quot;),DR010 = c(0,0,0,&quot;&quot;),DR011 = c(4,0,0,&quot;&quot;), 
         DR012 = c(0,0,0,&quot;&quot;), DR013 = c(0,0,1,&quot;&quot;), DR014 = c(0,0,0,&quot;&quot;)),
    class = &quot;data.frame&quot;, row.names = c(NA, -4L))
  
  &gt; df1
          Date DR1 DR01 DR02 DR03 DR04 DR05 DR06 DR07 DR08 DR09 DR010 DR011 DR012 DR013 DR014
  1 30-06-2021   4    4    4    9    5    5    2    2    0    0     0     4     0     0     0
  2 01-07-2021   1    1    2    5    4    4    4    5    0    0     0     0     0     0     0
  3 02-07-2021   4    4    6    4    3    5    3    4    0    0     0     0     0     1     0
  4 03-07-2021   1    2    2    2    3
  
  &gt; class(df1)
  [1] &quot;tbl_df&quot;     &quot;tbl&quot;        &quot;data.frame&quot;
  </code></pre>