title: Keeping track of cumulative travel using dplyr
body: <p>I'm attempting to keep track of a team's cumulative travel throughout a season, but having trouble trying to figure out the best way to do that since teams change who is home/away throughout the season.</p>
  <p>Here is my dataframe:</p>
  <pre><code>df &lt;- data.frame(game_id = c('1', '2', '3'),
                   Home_Abbr = c('PHI', 'DAL', 'PIT'),
                   Away_Abbr = c('DAL', 'PIT', 'PHI'),
                   Home_Travel = c('0', '0', '0'),
                   Away_Travel = c('1000', '500', '750'))
  </code></pre>
  <p>Here is what I would like:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>game_id</th>
  <th>Home_Abbr</th>
  <th>Away_Abbr</th>
  <th>Home_Travel</th>
  <th>Away_Travel</th>
  <th>Home_Cum_Travel</th>
  <th>Away_Cum_Travel</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>PHI</td>
  <td>DAL</td>
  <td>0</td>
  <td>1000</td>
  <td>0</td>
  <td>1000</td>
  </tr>
  <tr>
  <td>2</td>
  <td>DAL</td>
  <td>PIT</td>
  <td>0</td>
  <td>500</td>
  <td>1000</td>
  <td>500</td>
  </tr>
  <tr>
  <td>3</td>
  <td>PIT</td>
  <td>PHI</td>
  <td>0</td>
  <td>750</td>
  <td>500</td>
  <td>750</td>
  </tr>
  </tbody>
  </table>
  </div>