Learn R Programming

VecStatGraphs3D (version 1.6)

DrawDensity3D: Graphic representation of a point Density Map.

Description

The density map was built as follows: a) vectors are moved to a common origin without changing its angle and module, b) end position perform a point cloud of varying density that depends on the accumulation of vectors with similar properties, c) end positions are used for to calculate the density map as a surface with values depending on the end-position accumulation per area unit. Areas where there is a greater number of points (end position of the vectors) will have a deeper color (red), while the areas a lesser density will have a less intense color (white).

Usage

DrawDensity3D(vectors, Div = 40, Layers = 3, DrawAxes = FALSE)

Arguments

vectors
Matrix containing the values of the coordinates
Div
Integer value that indicates the number of divisions that will have the density map. The default value is 40
Layers
Integer value that indicates the number of layers that will have the density map. The default value is 3
DrawAxes
Logical value, if DrawAxes=TRUE draw axes, if DrawAxes=FALSE draw not axes. The default value is FALSE

Value

This function returns no value, creates a 3D Graph that represents a density map of the input values.

Details

Kernel descriptors are used to create the density map. To perform these calculations the MASS package is required. The parameter Div is very important because a very large value will cause the creation of the slow density map, and a very small value would create a ineffective density map. One way to get a set of coordinates X, Y and Z of the origin position and end position (coordinates X, Y and Z of the vector) or of the colatitude and longitude, it is using the LoadData3D function. Typical usages are
    DrawDensity3D(vectors, ...)
	DrawDensity3D(vectors, Div = 60, ...)
	DrawDensity3D(vectors, Layers = 4, DrawAxes = TRUE, ...)
    ......
	

References

Website http://gim.unex.es/VecStatGraphs2D/

See Also

DrawModuleAndAngleDistribution3D.

Examples

Run this code
   FileName<-system.file("data/XYZcoor.txt", package="VecStatGraphs3D")
   dat<-LoadData3D(FileName, Type=1)
   coordinates<-dat[,4:6]
   DrawDensity3D(coordinates, Layers=3, Div=50)

Run the code above in your browser using DataLab