Learn R Programming

cytofkit (version 1.4.8)

cytof_clusterPlot: Scatter plot of the cluster results

Description

Dot plot visualization of the cluster results, with color indicating different clusters, and shape of different samples.

Usage

cytof_clusterPlot(data, xlab, ylab, cluster, sample, title = "cluster", type = 1, point_size = NULL, addLabel = TRUE, labelSize = 10, sampleLabel = TRUE, labelRepel = FALSE, fixCoord = TRUE)

Arguments

data
The data frame of cluster results, which should contains at least xlab, ylab and cluster.
xlab
The column name of the x axis in input data.
ylab
The column name of the y axis in input data.
cluster
The column name of cluster in input data.
sample
the column name of the sample in input data.
title
the title of the plot.
type
plot type, 1 indicates combined plot, 2 indicated grid facet plot seperated by samples.
point_size
the size of the dot.
addLabel
Boolean, if add cluster labels.
labelSize
the size of cluster labels.
sampleLabel
If use point shapes to represent different samples.
labelRepel
If repel the cluste labels to avoid label overlapping.
fixCoord
If fix the Cartesian coordinates.

Value

the ggplot object of the scatter cluster plot.

Examples

Run this code
x <- c(rnorm(100, mean = 1), rnorm(100, mean = 3), rnorm(100, mean = 9))
y <- c(rnorm(100, mean = 2), rnorm(100, mean = 8), rnorm(100, mean = 5))
c <- c(rep(1,100), rep(2,100), rep(3,100))
rnames <- paste(paste('sample_', c('A','B','C'), sep = ''), rep(1:100,each = 3), sep='_') 
data <- data.frame(dim1 = x, dim2 = y, cluster = c)
rownames(data) <- rnames
data$sample <- "data"
cytof_clusterPlot(data, xlab="dim1", ylab="dim2", cluster="cluster", sample = "sample")

Run the code above in your browser using DataLab