multi.line | R Documentation |
Draw multiple regression or lowess lines
multi.line(
x,
y,
group,
main = "",
axes = TRUE,
xlab = "",
ylab = "",
xlim = range(x, na.rm = T),
ylim = range(y, na.rm = T) + c(0, (max(y, na.rm = T) - min(y, na.rm = T))/10),
points = TRUE,
col = rainbow(length(levels(factor(group)))),
pch = 1:length(levels(factor(group))),
cex = 1,
lines = TRUE,
lty = 1:length(levels(factor(group))),
lwd = 2,
type = "line",
locator = "top",
horiz = TRUE,
names = paste(levels(group), " ")
)
x |
independend metric variable |
y |
dependend metric variable |
group |
grouping variable |
main |
title |
axes |
draw axes |
xlab |
x axis label |
ylab |
y axis label |
xlim |
x axis limits |
ylim |
y axis limits |
points |
draw points |
col |
point color |
pch |
point character |
cex |
point size |
lines |
draw lines |
lty |
line type |
lwd |
line width |
type |
draw regression line/s or lowess line ("line", "lowess", "both") |
locator |
legend location |
horiz |
align horizontally |
names |
group names |
data(ChickWeight)
attach(ChickWeight)
Diet<-paste("Diet",ChickWeight$Diet)
multi.line(x=jitter(Time,2),y=weight,group=Diet,points=T,main="multi.line()",xlab="time",ylab="weight")
multi.line(x=jitter(Time,2),y=weight,group=Diet,points=F,main="multi.line() without points with lowess line",xlab="time",ylab="weight",type="lowess")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.