dResidualPlot: Showing the residuals when subtracting the values from one...

Description Usage Arguments Value See Also Examples

View source: R/dResidualPlot.R

Description

This function is used to visually compare groups of individuals from whom comparable cytometry or other complex data has been generated, but where the number of individuals does not permit any statistical comparisons.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
dResidualPlot(
  xYData,
  groupVector,
  clusterVector,
  densContour = TRUE,
  groupName1 = unique(groupVector)[1],
  groupName2 = unique(groupVector)[2],
  plotName = "default",
  title = FALSE,
  maxAbsPlottingValues,
  bandColor = "black",
  plotDir = ".",
  dotSize = 400/sqrt(nrow(xYData)),
  createOutput = TRUE
)

Arguments

xYData

A dataframe or matrix with two columns. Each row contains information about the x and y positition in the field for that observation.

groupVector

Vector with the same length as xYData containing information about the group identity of each observation.

clusterVector

Vector with the same length as xYData containing information about the cluster identity of each observation.

densContour

If density contours should be created for the plot(s) or not. Defaults to TRUE.

groupName1

The name for the first group

groupName2

The name for the second group

plotName

The main name for the graph and the analysis.

title

If there should be a title displayed on the plotting field. As the plotting field is saved as a png, this title cannot be removed as an object afterwards, as it is saved as coloured pixels. To simplify usage for publication, the default is FALSE, as the files are still named, eventhough no title appears on the plot.

maxAbsPlottingValues

If multiple plots should be compared, it might be useful to define a similar color scale for all plots, so that the same color always means the same value. Such a value can be added here. It defaults to the maximum Wilcoxon statistic that is generated in the analysis.

bandColor

The color of the contour bands. Defaults to black.

plotDir

If different from the current directory. If specified and non-existent, the function creates it. If "." is specified, the plots will be saved at the current directory.

dotSize

Simply the size of the dots. The default makes the dots smaller the more observations that are included.

createOutput

For testing purposes. Defaults to TRUE. If FALSE, no plots are generated.

Value

A sne based plot showing which events that belong to a cluster dominated by the first or the second group.

See Also

dColorPlot, dDensityPlot, dWilcox

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Load some data
data(testData)
## Not run: 
# Load or create the dimensions that you want to plot the result over. 
# uwot::umap recommended due to speed, but tSNE or other method would
# work as fine. 
data(testDataSNE)

# Run the clustering function. For more rapid example execution,
# a depeche clustering of the data is inluded
# testDataDepeche <- depeche(testData[,2:15])
data(testDataDepeche)


# And finally run the function
dResidualPlot(
    xYData = testDataSNE$Y, groupVector = testData[, 16],
    clusterVector = testDataDepeche$clusterVector
)

## End(Not run)

DepecheR documentation built on Nov. 8, 2020, 5:44 p.m.