wurmlab / SBC361-programming-in-R

QMUL's programming in R course
https://wurmlab.github.io/SBC361-programming-in-R/practical1.html
5 stars 11 forks source link

prac2 q1 #25

Closed yannickwurm closed 7 years ago

yannickwurm commented 7 years ago
yannickwurm commented 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"

yannickwurm commented 7 years ago

"consumming" -> spelling

yannickwurm commented 7 years ago

q5 tests should include relevant ones (e.g. 0, 1m/s) where we know what answer to expect

yannickwurm commented 7 years ago

"use Google" --> "use an internet search engine"

yannickwurm commented 7 years ago

loop_values <- c(1:50) - NO reason for c()

This intro to loops would benefit from fewer examples. Actually just delete the following:

Non-sequential loop values

loop_values <- c(1:50) for (value in loop_values) { print(value) }

The same as writing:

for (value in 1:50) { print(value) }

yannickwurm commented 7 years ago

How about just using the word "position" instead of index?

yannickwurm commented 7 years ago

What's -> what is

yannickwurm commented 7 years ago

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

yannickwurm commented 7 years ago

for (practical_attribute in practical_attribute_vec) {

Indentation is too big. We should do the standard from had.co.nz (4? spaces?)

yannickwurm commented 7 years ago

for (my_row in 1:5) { <-- should use 1:number_of_rows (and add a line above to get nrows(table)

EmelineFavreau commented 7 years ago

All suggestions have been applied here #c6991f0, except q5 one.

EmelineFavreau commented 7 years ago

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.