Skip to content

Instantly share code, notes, and snippets.

@abikoushi
Created June 19, 2024 06:34
Show Gist options
  • Save abikoushi/c0e08df5e37d50335e66f98f0f116b98 to your computer and use it in GitHub Desktop.
Save abikoushi/c0e08df5e37d50335e66f98f0f116b98 to your computer and use it in GitHub Desktop.
SVD in the Parallel coordinates plot
Y<-iris[,-5]
svdout <- svd(log(Y))
cname <- hcl.colors(3, alpha = 0.1)
#png("iris_svd.png")
matplot(t(svdout$u),
type = "l",lty=1,
col = cname[iris$Species],
xlab = "PC", ylab = "value")
legend("topleft", legend = levels(iris$Species),
col=hcl.colors(3), lty=1)
#dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment