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 == '2014-01-02' to '2014-31-12'
# sum of the half an hour data into daily total.
day1 <- subset(df, DATE =='2014-01-01',select= FridgeRange)
sum(day1)
Please if you can also add the result to a dataframe that will be awesome.