Good day .All is fine when working within Rstudio/RMD . I only get error message when trying to Knit to Word . The Knit process stops when it gets to the "preProcess()" function from Caret. I have checked the syntax and loading of relevant packages to no avail . I'm at a dead-end . Can somebody help?
R Code for Caret :
##Determine the means and sd's and Use the Predict() function to do the adjustments
preProcValues=caret::preProcess(trainSet,method = c("center","scale","YeoJohnson"))
trainScaled=predict(preProcValues,trainSet)
testScaled=predict(preProcValues,testSet)
Error Message :
Quitting from lines 864-872 (InsuranceDefault4a.Rmd)
Error in complete.cases(x) : not all arguments have the same length
Calls: ... preProcess.default -> [ -> [.data.frame -> complete.cases