When to install.packages for grader

Dr. Ballings,

For the stock project I create a few extra variables using the "lubridate" package for my KNN algorithm. Should I include
"install.packages(lubridate)" and "library(lubridate)" in my prediction function? Or have install.packages right before he creates the
prediction function? Also I assume he has the KNN algorithm package installed so i don't have to include the code for him installing the KNN


Answers and follow-up questions

Answer or follow-up question 1

Dear John,

Make no assumptions. Nothing is pre-installed.
Also, make sure that the function does not install the package each and every time it is called.
It should check if it is installed, and if not, install it.

Michel Ballings

Sign in to be able to add an answer or mark this question as resolved.