Skip to content

Instantly share code, notes, and snippets.

@monogenea
Created October 7, 2019 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monogenea/14c3b479217ad63984e755534e4ffd53 to your computer and use it in GitHub Desktop.
Save monogenea/14c3b479217ad63984e755534e4ffd53 to your computer and use it in GitHub Desktop.
# Name the variables
colnames(wine) <- c("Cvs","Alcohol","Malic acid","Ash",
"Alcalinity of ash", "Magnesium",
"Total phenols", "Flavanoids",
"Nonflavanoid phenols", "Proanthocyanins",
"Color intensity", "Hue",
"OD280/OD315 of diluted wines", "Proline")
# The first column corresponds to the classes
wineClasses <- factor(wine$Cvs)
# Use pairs
pairs(wine[,-1], col = wineClasses, upper.panel = NULL,
pch = 16, cex = 0.5)
legend("topright", bty = "n", legend = c("Cv1","Cv2","Cv3"),
pch = 16, col = c("black","red","green"),
xpd = T, cex = 2, y.intersp = 0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment