predplot function of PLS package using Mid spectral data

I trying to plot plsfitB model of soil mid-infrared spectral data using predplot function of caret package using rstudio
RES <- predplot(object = plsFitB, ncomp = nb_comp, newdata = testing, line = T, main = "Validation result by LHS method", xlab = "Measured organic carbon (%)", ylab = "Estimated organic carbon content(%)", xlim = c(0,40), ylim = c (0,40)).

I got this error
Error in (function (formula, data = NULL, subset = NULL, na.action =, :
variable lengths differ (found for 'x').
Is there any way to plot this data