plotsl: Plot of slopes of between elemnts of a vector

View source: R/plotsl.R

plotslR Documentation

Plot of slopes of between elemnts of a vector

Description

Plot the slopes or differences between two successive elements of a vector x.

The function is mainly used by other functions, such as selscree, etc.

Usage


plotsl(x,
    start = 1,
    plot = c("slope", "diff", "none"),
    xlab = "Index", ylab = "Value",
    ...)

Arguments

x

A numeric vector.

start

Starting value for indexing the elements of vector x (default to 1).

plot

Type of plot. Possible values are "slope" (slopes), "diff" (differences) and "none" (no plot; only the output dataframe is returned).

xlab

x-axis label of the plot of r (left-side in the graphic window).

ylab

y-axis label of the plot of r (left-side in the graphic window).

...

Optionnal arguments to pass through function plot.

Value

A list (invisible) of outputs, see the examples.

Examples


data(datoctane)
X <- datoctane$X
## removing outliers
zX <- X[-c(25:26, 36:39), ]
plotsp(zX)

ncomp <- 30
fm <- pca_eigen(zX, ncomp = ncomp)
plotsl(fm$eig[seq(ncomp)], plot = "diff")

z <- plotsl(fm$eig[seq(ncomp)], plot = "none")
names(z)


mlesnoff/rnirs documentation built on April 24, 2023, 4:17 a.m.