plotDataGridDensity3D: Plot Density of two-dimensional Data in three dimensions

View source: R/plotDataGridDensity3D.R

plotDataGridDensity3DR Documentation

Plot Density of two-dimensional Data in three dimensions

Description

Visualize the density of a two-dimensional dataset in three dimensions.

Usage

plotDataGridDensity3D(Data, XKernel, YKernel, ContinuousDataPDE, EmpiricDataPDE,
Colors, Cls, Camera = NULL, ShowScatter = TRUE, AxNames = c("X", "Y"),
Source = "F1", Debug = F)

Arguments

Data

[1:n, 1:2] Numeric matrix with n observations and 2 features.

XKernel

[1:x] Numeric vector defining domain of x axis.

YKernel

[1:x] Numeric vector defining domain of y axis.

ContinuousDataPDE

[1:x, 1:x] Numeric matrix with density estimation of Data computed as grid on the domain defined by XKernel and YKernel in order to plot a continuous density plot.

EmpiricDataPDE

[1:n] Numeric vector with density estimation of Data defined for each datapoint within the Data.

Colors

[1:l] Character vector with l color names or more.

Cls

[1:n] Numeric vector with class assignment for n observations.

Camera

List of attributes concerning the camera angle for plotly visualizations.

ShowScatter

Boolean (Default=TRUE). T: Show Data Scatter with empirical estimated density. F: Do not show nothing.

AxNames

[1:2] Character vector with ax names for plot description.

Source

Character indicating plot source. Important attribute for plotly in shiny in order to keep control of specific panels.

Debug

Boolean (Default=FALSE). TRUE: Show developer information and warnings in terminal. FALSE: Show nothing.

Value

plotOut

Plotly object containing plot for direct visualization.

Author(s)

Quirin Stier

Examples

## Not run: 
data(EngyTime)
Data = EngyTime
densityMap = MASS::kde2d(Data[,1], Data[,2], n = 100)
z = sapply(1:nrow(Data), function(i){
  densityMap$z[
    which.min(abs(densityMap$x - Data[i,1])),
    which.min(abs(densityMap$y - Data[i,2]))
    ]
})
dataDensity = z
Cls = rep(1, nrow(Data))
DataSample = sample(1:nrow(Data), min(nrow(Data), 5000))
Colors = c("red", "blue")
Plot_3D_DataDensity(Data, DataSample, Colors, Cls, densityMap, dataDensity,
Show3DPoints = T, Source = "F1")

## End(Not run)

Mthrun/AdaptGauss2D documentation built on July 19, 2022, 3:11 a.m.