In the last sample code of this part, package RANN is being loaded, while this package seems not to need to be loaded.
Even without RANN loaded, the last 2 lines of code can still work well.
library(RANN)
knnImpute=preProcess(missing_tgexp,method="knnImpute")
knnimputedGexp=predict(knnImpute,missing_tgexp)
In the last sample code of this part, package RANN is being loaded, while this package seems not to need to be loaded.
Even without RANN loaded, the last 2 lines of code can still work well.