The great Fela sang “Teacher no teach me nonsense” .
While taking a course in Machine Learning the other day, I came across this:
To find this kind of code on a course amazed even me, an R neophyte, as there is so much wrong with this function that is wrong and it really left me puzzled. What made it worse was that the course is being organised by a highly reputable software giant.
But please, if you’re loading (or more correctly, attaching) a package within a function, do not call
library(); rather make use of
require(). This blog by the author of the knitr package explains it better than I ever could.