title: How to use map() function on multiple columns
body: <p>I have got a data frame which looks like this: </p>
  
  <pre><code>x1   x2   x3     x4   ...
  56   45   34    76    ...
  56+3 56   42    43    ...
  38   53   56-1  55+3  ...
  ...   ...   ...  ...   ...
  </code></pre>
  
  <p>In each row in more than 30 columns I want to keep only first 2 characters, so basically I want to remove all this "+3", "-1" etc. So in the end I will have:</p>
  
  <pre><code>x1   x2   x3     x4   ...
  56   45   34    76    ...
  56   56   42    43    ...
  38   53   56    55    ...
  ...   ...   ...  ...   ...
  </code></pre>
  
  <p>I used below code to make such change in a single column, but I would like to be able to implement it on multiple columns at once. In the end as you can see I need to make each column a factor. </p>
  
  <pre><code>A &lt;- substr(data$x1, start = 1, stop = 2)
  data$x1 &lt;- as.factor(A) 
  </code></pre>
  
  <p>I thought about using map function from purrr but I have no idea how to do it. </p>