title: algorithm to round to the next order of magnitude in R
body: <p>I apologize if the title is not clear, but I couldn't explain it succinctly.</p>
  
  <p>Given a vector of concentrations, I would like to round the maximum value to the next order of magnitude (i.e., 345 to 1000). Also, I would like to round the minimum value to the lower order of magnitude (i.e., 3.2 to 1). These concentrations may also be below 1 so for example 0.034 would need to be rounded to 0.01.</p>
  
  <p>Any ideas?</p>