Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Lowess.groups

Plot data in groups, each group with separate lowess smoothing


Description

data in groups (shown by variable group) are plotted

Usage

lowess.bygroup(x, y, group, span=2/3, col=seq_along(x), lty=seq_along(x))

Arguments

x, y

coordinate vectors of equal length

group

grouping variable, must be a vector of same length as x and y

span

span of smooting

col

colour of lines

lty

line type

Value

The procedure is called for its side effect of producing a plot

Author(s)

Christian W. Hoffmann, christian@echoffmann.ch

Examples

par(mfrow=c(1,1))
  gr <- c(rep(1,20),rep(2,30),rep(3,50))
  x <- seq_along(gr); y <- jitter(0.01*(x-50)^2 + 1,1000)
  plot(x,y,pch=".",cex=4,xlab="Lowess, with spans = 0.2 (r,g,mag), 0.4 (blue) ")
  lowess.bygroup(x,y,gr,span=0.2,col=c("red","green","magenta"),lty=rep(2,3))
  lowess.bygroup(x,y,gr,span=0.4,col="blue")

cwhmisc

Miscellaneous Functions for Math, Plotting, Printing, Statistics, Strings, and Tools

v6.6
GPL (>= 2)
Authors
Christian W. Hoffmann
Initial release
2018-08-24, 10:40:10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.