plotSpatial2D {rliger} | R Documentation |
Visualize a spatial dataset
Description
Visualize a spatial dataset
Usage
plotSpatial2D(object, ...)
## S3 method for class 'liger'
plotSpatial2D(object, dataset, useCluster = NULL, legendColorTitle = NULL, ...)
## S3 method for class 'ligerSpatialDataset'
plotSpatial2D(
object,
useCluster = NULL,
legendColorTitle = NULL,
useDims = c(1, 2),
xlab = NULL,
ylab = NULL,
labelText = FALSE,
...
)
Arguments
object |
Either a liger object containing a spatial dataset or a ligerSpatialDataset object. |
... |
Arguments passed to other methods. |
dataset |
Name of one spatial dataset. |
useCluster |
Either the name of one variable in |
legendColorTitle |
Alternative title text in the legend. Default
|
useDims |
Numeric vector of two, choosing the coordinates to be drawn
on 2D space. (STARmap data could have 3 dimensions.) Default |
xlab , ylab |
Text label on x-/y-axis. Default |
labelText |
Logical, whether to label annotation onto the scatter plot.
Default |
Value
A ggplot object
Examples
ctrl.fake.spatial <- as.ligerDataset(dataset(pbmc, "ctrl"), modal = "spatial")
fake.coords <- matrix(rnorm(2 * ncol(ctrl.fake.spatial)), ncol = 2)
dimnames(fake.coords) <- list(colnames(ctrl.fake.spatial), c("x", "y"))
coordinate(ctrl.fake.spatial) <- fake.coords
dataset(pbmc, "ctrl") <- ctrl.fake.spatial
plotSpatial2D(pbmc, dataset = "ctrl")