0

I am working on running a PLS model in R to analyze data I have for FTIR and Enzyme activity. For some reason it is giving me error message that it can't find "Pk_1260" which is one of my columns in my spreadsheet. I have run over analyses on this spreadsheet so I know it is uploaded correctly so I am not sure why I am getting this error.

Let me know if you have ideas how to fix! Thank you!

This is the error code: The exact code is: Error in isTRUE(x) : object 'Pk_1260' not found

Moirajm
  • 1
  • 1
  • The covariates in your formula should be separated by `+`, not `,`. What you have in the image is the wrong syntax. It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. Please [do not post code or data in images](https://meta.stackoverflow.com/q/285551/2372064) – MrFlick Jul 20 '23 at 19:05
  • Thank you! I turned the "," to "+" and now it gave me this error: Error in cvsegments(nobj, k = segments, type = segment.type) : More segments than observations requested – Moirajm Jul 20 '23 at 19:22
  • Here is my code: fullmodel <- (plsr(BG_Activity ~ Pk_1030+Pk_1040+Pk_1050+Pk_1060+Pk_1150+ Pk_1160+Pk_1240+Pk_1260+Pk_1270+Pk_1370+Pk_1380+Pk_1420+ Pk_1430+Pk_1510+Pk_1610+Pk_1620+Pk_1640+Pk_1650+Pk_1730+ Pk_2850+Pk_2920+Pk_2930+Pk_3340+Pk_3350+Pk_3360+Pk_3370, data=lastest_master, scale=TRUE, validation="CV")) – Moirajm Jul 20 '23 at 19:22
  • 1
    Make sure to edit/update the question with the correct information. If it's a new problem, create a new question. Make sure we can recreate the problem by supplying data and code in a format we can copy/paste into our R session to test. How many rows of data do you have? Are you sure you have enough data to estimate that many parameters? – MrFlick Jul 20 '23 at 19:40

0 Answers0