whether ticks in the x and y axis appear in the plot
xlim
the x limit
ylim
the y limit
show
whether to show the graph or not
save
whether to save the output as a list or not
data
the data file data
xlab
the x label as character string
ylab
the y label as character string
cols
for changing the color scheme, the defaul is
heat.colors(10:200). Other suggestions are
gray(0:100/100),
heat.colors(101),
rainbow(100:200),
terrain.colors(101),
topo.colors(101),
cm.colors(101). Note that if you have the package
colorspace in R you can used
heat_hcl(100) which was the default before.
col.points
the colours of the points
...
for extra arguments
Details
The function is similar to the function smoothScatter() in graphics but it used penelized bin smoother as
described in Eilers and Goeman (2004) rather than kernel smoother.
Value
the function produces a two dimensional smooth plot and saves if save=TRUE a list with the following components:
Hraw
A nbin by nbin matrix containing the bin row data
Hsmooth
A nbib by nbib matrix containing the smooth two dimensional histogram
Eilers, P. H. C. and Goeman, J. J. (2004). Enhancing scatterplots with smoothed density. Bioinformatics,
Vol 20 no 5, pp 623-628.
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion),
Appl. Statist., 54, part 3, pp 507-554.
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R.
Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, http://www.jstatsoft.org/v23/i07.
See Also
smoothScatter,gamlss
Examples
m <- 1000
set.seed(pi)
phi <- 2 * pi * runif(m)
rho <- rchisq(m, df = 6)
x <- cos(phi) * rho
y <- sin(phi) * rho
H <- scattersmooth(x, y)
H1 <- scattersmooth(x, y, cols=rainbow(100:200))
# If you have the package colorspace use instead
# library(colorspace)
# H <- scattersmooth(x, y, cols=heat_hcl(100))
# H1 <- scattersmooth(x, y, cols=rainbow_hcl(100))
data(db)
scattersmooth(age, head, data=db, cols=terrain.colors(101), ndot=2000, lambda=1)
# or if you have colorspace
#scattersmooth(age, head, data=db, cols=terrain_hcl(100), ndot=2000, lambda=1)