I'm using PLS package and was trying to print the loading plot using the follwing code. I've wanted that the X axis to be the wavelength value that is the column names of my df. But it somehow plot the number of column (that is the number of wavelengths) instead of the wavelengths. Appreciate any advice.
> dfq[1,1:5]
percent 1352.94 1357.53 1361.75 1365.98
1 0.5 0.0548 0.077 0.1015 0.1299
>
> qfit
Partial least squares regression , fitted with the kernel algorithm.
Cross-validated using 150 leave-one-out segments.
Call:
plsr(formula = dfq$percent ~ ., ncomp = 10, data = dfq, validation = "LOO")
>
> plot(qfit, "loadings", comps = 1:3, legendpos = "topright",
+ xlab = "nm", ylim=c(-0.3,0.85), xlim=c(0,230));
> abline(h=0)