forked from satijalab/seurat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLabelClusters.Rd
58 lines (48 loc) · 1.5 KB
/
LabelClusters.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualization.R
\name{LabelClusters}
\alias{LabelClusters}
\title{Label clusters on a ggplot2-based scatter plot}
\usage{
LabelClusters(
plot,
id,
clusters = NULL,
labels = NULL,
split.by = NULL,
repel = TRUE,
box = FALSE,
geom = "GeomPoint",
position = "median",
...
)
}
\arguments{
\item{plot}{A ggplot2-based scatter plot}
\item{id}{Name of variable used for coloring scatter plot}
\item{clusters}{Vector of cluster ids to label}
\item{labels}{Custom labels for the clusters}
\item{split.by}{Split labels by some grouping label, useful when using
\code{\link[ggplot2]{facet_wrap}} or \code{\link[ggplot2]{facet_grid}}}
\item{repel}{Use \code{geom_text_repel} to create nicely-repelled labels}
\item{box}{Use geom_label/geom_label_repel (includes a box around the text
labels)}
\item{geom}{Name of geom to get X/Y aesthetic names for}
\item{position}{How to place the label if repel = FALSE. If "median", place
the label at the median position. If "nearest" place the label at the
position of the nearest data point to the median.}
\item{...}{Extra parameters to \code{\link[ggrepel]{geom_text_repel}}, such as \code{size}}
}
\value{
A ggplot2-based scatter plot with cluster labels
}
\description{
Label clusters on a ggplot2-based scatter plot
}
\examples{
plot <- DimPlot(object = pbmc_small)
LabelClusters(plot = plot, id = 'ident')
}
\seealso{
\code{\link[ggrepel]{geom_text_repel}} \code{\link[ggplot2]{geom_text}}
}