Summation in r for loop. rm: Whether to ignore NA values.