6.2 Calculations with Lists of Numbers
Instead of calculating one value of \(t\), you could include a list of numbers like:
<- seq(from = 0, to = 5, by = 0.5)
t t
Then you might think that accum would automatically be recalculated. Try it.
accum
Hum. That did not work, did it? The function accum did not change! Why? How can you make this work?
The simplest way to make this work is it to re-run the original code for accum and recalculate:
<- 1 + i*t
accum accum
Now you have the 11 values of accum calculated for each value of \(t\). While the original accum calculation looked like a function, it was replaced with a value once you inserted specific values for \(i\) and \(t\).