dContours: Create density contours for two-dimensional data.

View source: R/dContours.R

dContoursR Documentation

Create density contours for two-dimensional data.

Description

Here, contour lines for two-dimensional data are construced. It is primarily thought to be used in the context of SNE plots in this package. This function is used both internally in other functions suchas sneFluoroPlot and sneDensityPlot, but also as a standalone function, as it increases speed greatly to generate the density curves only once per overall analysis.

Usage

dContours(xYData, control, n = 100)

Arguments

xYData

A dataframe with two columns containing position information for each observation in the dataset. Typically, this is the raw result from the SNE analysis.

control

A numeric/integer vector or dataframe of values that could be used to define the range in the internal dScale. If no control data is present, the function defaults to using the indata as control data.

n

The number fo grid points. Default is 100.

Value

A list of three components

x, y

The x and y coordinates of the grid points, vectors of length n.

z

An n[1] by n[2] matrix of the estimated density: rows correspond to the value of x, columns to the value of y.

See Also

dColorPlot, dDensityPlot, dResidualPlot, dWilcox

Examples

# Load the test SNE data
data(testDataSNE)


# Run the function
contour_result <- dContours(testDataSNE$Y)

Theorell/DepecheR documentation built on July 27, 2023, 8:13 p.m.