You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just been watching lecture 2, and when R example 2.1 comes up (35:00), you explain that
For those of you who don't use R, sapply is just a loop, it's just a function that loops over a list
Because R vectorises functions by default, you don't need to use sapply here. This might make the code flow clearer, since you wouldn't need to explain the purpose of sapply.
I've written a small counter-example that uses vectorisation rather than sapply:
I've just been watching lecture 2, and when R example 2.1 comes up (35:00), you explain that
Because R vectorises functions by default, you don't need to use sapply here. This might make the code flow clearer, since you wouldn't need to explain the purpose of sapply.
I've written a small counter-example that uses vectorisation rather than sapply:
Created on 2023-03-20 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: