heatpoint: heatpoint packages is created for the desity plot, It can...

View source: R/heatpoint.R

heatpointR Documentation

heatpoint packages is created for the desity plot, It can caculate the point density in 2-dimension coordinate or 1D coordinate by the parameter 'only'.

Description

heatpoint packages is created for the desity plot, It can caculate the point density in 2-dimension coordinate or 1D coordinate by the parameter 'only'.

Usage

heatpoint(
  x,
  y,
  xlim = NULL,
  ylim = NULL,
  log = "",
  grid = 100,
  only = "none",
  method = "pearson",
  formula = y ~ x,
  ...
)

Arguments

x

the input data need vector or list number, if the dataframe colunm should use '$' or '[]'.

y

the other input data caculate for the density for x input.

xlim

input must be a vctor,the limit of the x input number for caculate desity.

ylim

input must be a vctor,the limit of the y input number for caculate desity.

log

a character string which contains "x" if the x axis is to be logarithmic, "y" if the y axis is to be logarithmic and "xy" or "yx" if both axes are to be logarithmic.

grid

the input number will be cut for several zones for caculate the desity, the grid parameter more small ,the desity will be more slight and more time need.

only

a character string which contains 'x' if the density should only be computed for the x axis, 'y' for the y axis (defaults to 'none' for the two-dimensional case).

method

a character specifying the correlation method to use ('pearson' (default), 'kendall' or 'spearman').

formula

the lm formula,the defult is 'y ~ x'

...

additional parameters to be passed to points and plot.

Value

the list object including the plot data and the result of the correlation adn lm.

Note

Two-Dimensional Kernel Density Estimation adapted and modified from Venables and Ripley's MASS package (see reference).

Author(s)

Jiaxuan Wang

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

See Also

The LSD packages, the wonderful R packages created by Achim Tresch and Bjoern Schwalb

Examples

points = 5000
x = c(rnorm(points/2))
y = x + rnorm(points/2,sd=0.8)
x = sign(x)*abs(x)^1.3
heatpoint(x,y) -> dat_result

wangjiaxuan666/xbox documentation built on Sept. 4, 2024, 5:03 p.m.