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 = na.fail, :
variable lengths differ (found for 'x').
Is there any way to plot this data

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.