## EXAMPLE 1
data(cassav)
X <- cassav$Xtest
n <- nrow(X)
plotsp(X)
plotsp(X, col = "grey")
plotsp(X, col = "lightblue",
xlim = c(500, 1500),
xlab = "Wawelength (nm)", ylab = "Absorbance")
col <- hcl.colors(n = n, alpha = 1, rev = FALSE, palette = "Grays")
plotsp(X, col = col)
plotsp(X, col = "grey")
plotsp(X[23, , drop = FALSE], lwd = 2, add = TRUE)
plotsp(X[c(23, 16), ], lwd = 2, add = TRUE)
plotsp(X[5, , drop = FALSE], labels = TRUE)
plotsp(X[c(5, 61), ], labels = TRUE)
col <- hcl.colors(n = n, alpha = 1, rev = FALSE, palette = "Grays")
plotsp(X, col = col)
plotsp(X[5, , drop = FALSE], col = "red", lwd = 2, add = TRUE, labels = TRUE)
## EXAMPLE 2 (Scrolling plot of PCA loadings)
data(cassav)
X <- cassav$Xtest
fm <- pcaeigenk(X, nlv = 20)
P <- fm$P
plotsp1(t(P), ylab = "Value")
Run the code above in your browser using DataLab