I'm trying to learn how to use apply, but am getting a bit stuck. This loop is converting all of the columns (except the first four) to their accumulated sums.
Can anyone help me? Thanks!
for (i in seq_along(newbuilds.byfuel.bydate)) {
if (i >= 5) {
newbuilds.byfuel.bydate[i] <- cumsum(newbuilds.byfuel.bydate[i])
}
}