Learn R Programming

dimRed (version 0.2.6)

plot: Plotting of dimRed* objects

Description

Plots a object of class dimRedResult and dimRedData. For the documentation of the plotting function in base see here: plot.default.

Usage

plot(x, y, ...)

# S4 method for dimRedData,ANY plot( x, type = "pairs", vars = seq_len(ncol(x@data)), col = seq_len(min(3, ncol(x@meta))), ... )

# S4 method for dimRedResult,ANY plot( x, type = "pairs", vars = seq_len(ncol(x@data@data)), col = seq_len(min(3, ncol(x@data@meta))), ... )

Arguments

x

dimRedResult/dimRedData class, e.g. output of embedded/loadDataSet

y

Ignored

...

handed over to the underlying plotting function.

type

plot type, one of c("pairs", "parpl", "2vars", "3vars", "3varsrgl")

vars

the axes of the embedding to use for plotting

col

the columns of the meta slot to use for coloring, can be referenced as the column names or number of x@data

Methods (by class)

  • x = dimRedData,y = ANY: Ploting of dimRedData objects

  • x = dimRedResult,y = ANY: Ploting of dimRedResult objects.

Details

Plotting functions for the classes usind in dimRed. they are intended to give a quick overview over the results, so they are somewhat inflexible, e.g. it is hard to modify color scales or plotting parameters.

If you require more control over plotting, it is better to convert the object to a data.frame first and use the standard functions for plotting.

Examples

Run this code
scurve = loadDataSet("3D S Curve")
if(requireNamespace("graphics", quietly = TRUE))
  plot(scurve, type = "pairs", main = "pairs plot of S curve")
if(requireNamespace("MASS", quietly = TRUE))
  plot(scurve, type = "parpl")
if(requireNamespace("graphics", quietly = TRUE))
  plot(scurve, type = "2vars", vars = c("y", "z"))
if(requireNamespace("scatterplot3d", quietly = TRUE))
  plot(scurve, type = "3vars")
if(requireNamespace("rgl", quietly = TRUE))
  plot(scurve, type = "3varsrgl")

Run the code above in your browser using DataLab