Closed yannickwurm closed 7 years ago
"Hopefully you can already see how functions can be useful. " --> "Functions can be very useful when you have to do the same calculation many times"
"consumming" -> spelling
q5 tests should include relevant ones (e.g. 0, 1m/s) where we know what answer to expect
"use Google" --> "use an internet search engine"
loop_values <- c(1:50) - NO reason for c()
This intro to loops would benefit from fewer examples. Actually just delete the following:
loop_values <- c(1:50) for (value in loop_values) { print(value) }
for (value in 1:50) { print(value) }
How about just using the word "position" instead of index?
What's -> what is
the Example ## Sequential loop values
for (value in my_favourite_numbers) {
print(paste(value, "is my favourite number"))
}
Would benefit by doing something addition. I suggest calculating (and displaying) the cumulative sum at each iteration
for (practical_attribute in practical_attribute_vec) {
Indentation is too big. We should do the standard from had.co.nz (4? spaces?)
for (my_row in 1:5) { <-- should use 1:number_of_rows
(and add a line above to get nrows(table)
All suggestions have been applied here #c6991f0, except q5 one.
Q5 now includes testable distances (0 and 1) and time (0 and 8s). By the way, a bee's speed is in average 24km per hour.
floor()
is R's built-in function function for rounding down to the closest whole number)