heatmapPlotDS {dsBase}  R Documentation 
This function calculates the coordinates of the centroids for each n nearest neighbours.
heatmapPlotDS(x, y, k, noise, method.indicator)
x 
the name of a numeric vector, the xvariable. 
y 
the name of a numeric vector, the yvariable. 
k 
the number of the nearest neghbours for which their centroid is calculated if the

noise 
the percentage of the initial variance that is used as the variance of the embedded
noise if the 
method.indicator 
a number equal to either 1 or 2. If the value is equal to 1 then the 'deterministic' method is used. If the value is set to 2 the 'probabilistic' method is used. 
The function finds the n1 nearest neighbours of each data point in a 2dimensional space. The nearest neighbours are the data points with the minimum Euclidean distances from the point of interest. Each point of interest and its n1 nearest neighbours are then used for the calculation of the coordinates of the centroid of those n points. Centroid here is referred to the centre of mass, i.e. the xcoordinate of the centroid is the average value of the xcoordinates of the n nearest neighbours and the ycoordinate of the centroid is the average of the ycoordinates of the n nearest neighbours. The coordinates of the centroids return to the client side function and can be used for the plot of nondisclosive graphs (e.g. scatter plots, heatmap plots, contour plots, etc).
a list with the x and y coordinates of the centroids if the deterministic method is used or the x and y coordinated of the noisy data if the probabilistic method is used.
Demetris Avraam for DataSHIELD Development Team