title: Round number with arbitrary base, e.g.: base 7
body: <p>Is there a built-in (or existing in any package) function that rounds numbers with arbitrary base? E.g. a la <code>round_base(26,base = 7)</code> gives <code>28</code>. Thanks!</p>
  
  <p>Simple code:</p>
  
  <pre><code>n = 26.5
  base = 7
  
  a = round(n)
  print(a)
  for (i in round(a-base/2):round(a+base/2)) {
    if (i %% (base) == 0) a = i 
  }
  
  print(a)  
  
  [1] 28
  </code></pre>