title: Simple function to find maximum value up to each position in an array?
body: <p>Suppose we have the following data frame and we wish to find the maximum of column 'value' up to each row, i.e. the resulting new column should be <code>c(4993, 4993, 5036, 5036, 5036)</code>. Of course I can write a loop for this, but just wondering is there a simple dplyr solution as loops can get tedious to read?</p>
  <pre><code>&gt; myDf[1:5, ]
          time value
  1 2018-01-03  4993
  2 2018-01-15    52
  3 2018-08-02  5036
  4 2018-08-17  -162
  5 2018-09-05  4806
  </code></pre>
  <p>Many thanks!</p>