hexbin (version 1.27.1)

hexMA.loess: Add Loess Fit to Hexplot

Description

Fit a loess line using the hexagon centers of mass as the x and y coordinates and the cell counts as weights.

Usage

hexMA.loess(pMA, span = 0.4, col = "red", n = 200)
hexVP.loess(hbin, hvp = NULL, span = 0.4, col = "red", n = 200)

Arguments

hbin

an object of class hexbin, see hexbin.

hvp

A hexViewport object.

pMA

the list returned by plotMAhex.

span

the parameter alpha which controls the degree of smoothing.

col

line color for the loess fit.

n

number of points at which the fit should be evaluated.

Value

Returns invisibly the object associated with the loess fit.

See Also

hexVP.abline, plotMAhex, gplot.hexbin, hexViewport; loess

Examples

Run this code
# NOT RUN {
  if(require(marray)){
    data(swirl)
    
# }
# NOT RUN {
<!-- %% the following had     'newpage = FALSE, '  -- why ?? -->
# }
# NOT RUN {
    hb <- plotMAhex(swirl[,1], main = "M vs A plot with hexagons", legend=0)
    hexVP.abline(hb$plot, h=0, col= gray(.6))
    hexMA.loess(hb)
  }
# }

Run the code above in your browser using DataCamp Workspace