title: Apply a function to every value in a tibble (and return a tibble)?
body: <p>Straightforward usage here, but most documentation about apply/plyr/dplyr is explaining more complex operations.<br>
  I want to create a new tibble from <code>this_tbl</code></p>
  
  <pre><code>&gt; this_tbl
  # A tibble: 3 x 2
        x     y
    &lt;dbl&gt; &lt;dbl&gt;
  1    42   999
  2     0     0
  3     1     0
  </code></pre>
  
  <p>Such that every value > 0 is turned into a 1, and every value &lt;= 0 is  becomes a 0.</p>
  
  <pre><code>&gt; as_tibble(apply(this_tbl,2,function(x){ifelse(x&gt;0, 1, 0)}))
  # A tibble: 3 x 2
        x     y
    &lt;dbl&gt; &lt;dbl&gt;
  1     1     1
  2     0     0
  3     1     0
  </code></pre>
  
  <p>That works just fine, but is there a more elegant way to do this?</p>