plotsp | R Documentation |
plotsp
plots lines corresponding to the spectra (or more generally row observations) of a data set.
plotsp1
plots only one row observation per plot (i.e. spectrum by spectrum) by scrolling the rows. After running a plotsp1
command, the plots are printed successively by pushing the R console "entry button", and stopped by entering any character in the R console.
plotsp(X,
type = "l", col = NULL, zeroes = FALSE, labels = FALSE,
blocks = NULL, add = FALSE,
...)
plotsp1(X, col = NULL, zeroes = FALSE, ...)
X |
A |
type |
1-character string giving the type of plot desired. Default value to |
col |
A color, or a vector of colors (of length n), defining the color(s) of the lines representing the rows. |
zeroes |
Logical indicationg if an horizontal line is drawn at coordonates (0, 0) (Default to |
labels |
Logical indicating if the row names of |
blocks |
A list whose each component gives the column numbers in |
add |
Logical defining if the frame of the plot is plotted ( |
... |
Other arguments to pass in functions |
.
A plot (see examples).
data(datcass)
X <- datcass$Xu
n <- nrow(X)
plotsp(X)
plotsp(X, col = "grey")
plotsp(X, col = "lightblue",
xlim = c(500, 1500),
xlab = "Wawelength (nm)", ylab = "Absorbance")
### See: ?hcl.colors, hcl.pals()
col <- hcl.colors(n = n, alpha = 1, rev = FALSE, palette = "Grays")
#col <- hcl.colors(n = n, alpha = 1, rev = FALSE, palette = "Green-Orange")
#col <- terrain.colors(n, rev = FALSE)
#col <- rainbow(n, rev = FALSE, alpha = .2)
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[5, ])
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)
blocks <- list(1:500, 700:900)
plotsp(X, blocks = blocks)
###### Example with plotsp1
###### Scrolling plot of the loadings
## After running the code,
## type Enter in the R console for starting the scrolling,
## and type any character in the R console
fm <- pca(X, ncomp = 50)
P <- fm$P
#plotsp1(t(P), ylab = "Value")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.