samples | R Documentation |
This function allows the user to format the aesthetics for the samples.
samples (bp, which = 1:bp$g, col = ez.col, pch = 16, cex = 1,
label = FALSE, label.name = NULL, label.col=NULL, label.cex = 0.75,
label.side = "bottom", label.offset = 0.5,
connected=FALSE, connect.col = "black", connect.lty = 1,
connect.lwd = 1, opacity = 1)
bp |
an object of class |
which |
a vector containing the groups or classes for which the samples should be displayed, with default |
col |
the colour(s) for the samples, with default |
pch |
the plotting character(s) for the samples, with default |
cex |
the character expansion(s) for the samples, with default |
label |
a logical value indicating whether the samples should be labelled, with default |
label.name |
a vector of the same length as |
label.col |
a vector of the same length as |
label.cex |
a vector of the same length as |
label.side |
the side at which the label of the plotted point appears, with default |
label.offset |
the offset of the label from the plotted point. See |
connected |
a logical value indicating whether samples are connected in order of rows of the data matrix, with default |
connect.col |
the colour of the connecting line, with default |
connect.lty |
the line type of the connecting line, with default |
connect.lwd |
the line width of the connecting line, with default |
opacity |
the opacity level of the plotted points, with default |
The arguments which
, col
, pch
and cex
are based on the specification of group.aes
or classes
. If no groups are specified, a single colour, plotting character and / or character expansion is expected. If g
groups are
specified, vectors of length g
is expected, or values are recycled to length g
.
The arguments label
, label.cex
, label.side
and label.offset
are based on the sample size n
. A single value
will be recycled n
times or a vector of length n
is expected.
The object of class biplot
will be appended with a list called samples
containing the following elements:
which |
a vector containing the groups or classes for which the samples (and means) are displayed. |
col |
the colour(s) of the samples. |
pch |
the plotting character(s) of the samples. |
cex |
the character expansion(s) of the plotting character(s) of the samples. |
label |
a logical value indicating whether samples are labelled. |
label.name |
the label names of the samples. |
label.col |
the label colours of the samples. |
label.cex |
the label text expansions of the samples. |
label.side |
the side at which the label of the plotted point appears.. |
label.offset |
the offset of the label from the plotted point. |
connected |
a logical value indicating whether samples are connected in order of the rows of the data matrix. |
connect.col |
the colour of the connecting line. |
connect.lty |
the line type of the connecting line. |
connect.lwd |
the line width of the connecting line. |
opacity |
the opacity level of the plotted points. |
biplot()
biplot(iris[,1:4]) |> PCA() |> samples(col="purple",pch=15, opacity=0.5) |> plot()
biplot(iris[,1:4]) |> PCA() |>
samples(col="purple",pch=NA, opacity=0.5, label = TRUE) |> plot()
biplot(iris[,1:4]) |> PCA() |>
samples(col="purple",pch=NA, opacity=0.5, label = TRUE,
label.name = paste("s:",1:150, sep="")) |>
plot()
biplot(iris[,1:4]) |> PCA() |>
samples(col="purple",pch=NA, opacity=0.5, label = "ggrepel") |> plot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.