Code not working in "ChemometricsWithR" on Mac

pairs(wines[,1:3], pch = wine.classes, col = wine.classes)
Error in pairs.default(wines[, 1:3], pch = wine.classes, col = wine.classes) :
object 'wine.classes' not found.

I am new to the R community, and trying to teach myself to do Chemometrics using R. I am using the textbook, Chemometrics With R and it has an R package "ChemometricsWithR". When I try to plot the above pairs (wines[.....) it returns an error in pairs. I would be happy to learn why it is not working and what the work around is.

Thanks in advance

The error message is self explanatory, there is nothing called wine.classes in your working environment, to help you overcome this problem, it would be useful if you could provide a reproducible example.

If you've never heard of a reprex before, you might want to start by reading this FAQ:

Thanks andresrcs. Your response helped me identify the error. I managed to do the plot. Based on the example in the reprex help.

1 Like

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