Description Usage Arguments Details Author(s) Examples
Creates two and three dimensional plots of (labeled) data. It uses the library "rgl" for rotatable 3D scatterplots.
1 |
data |
matrix with values to be plotted (rows correspond to samples, columns to features) |
labels |
vector containing labels of the classes within the data (optional) |
axesLabels |
vector containing labels for the axes of the plot |
legend |
logical value whether to automatically insert a legend into the plot |
text |
vector with (short) labels for each point (optional) |
col |
character vector of colours for each class (optional); see |
pch |
character or integer value specifying the symbol when plotting points (see |
... |
other common R plot parameters like for example |
It colours the data points according to given class labels (max. six classes when using default colours). A legend will be printed in the R console by default (for three dimensional plots, a legend is not supported).
Christoph Bartenhagen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## plot a two dimensional LLE embedding of a 1.000 dimensional dataset
d = generateData(samples=20, genes=1000, diffgenes=100, blocksize=10)
d_low = LLE(data=d[[1]], dim=2, k=5)
plotDR(data=d_low, labels=d[[2]])
## plot a two dimensional LLE embedding of a 1.000 dimensional dataset
## add axis labels, a legend and plot a text for each sample
d = generateData(samples=20, genes=1000, diffgenes=100, blocksize=10)
d_low = LLE(data=d[[1]], dim=2, k=5)
text = letters[1:20]
plotDR(data=d_low, labels=d[[2]], axesLabels=c("first component", "second component"), text=text, legend=TRUE)
## manually add a legend to the plot
plotDR(data=d_low, labels=d[[2]], axesLabels=c("first component", "second component"), text=text)
legend("topright", legend=c("class 1","class 2"), col=c("black", "red"), pch=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.