I need a for loop to sum the values in a DataFrame column in r. The code below gives me the sum of the value when the date column == \'2014-01-01\'. I also need when date =