multi.line: multi.line

View source: R/multi.line.R

multi.lineR Documentation

multi.line

Description

Draw multiple regression or lowess lines

Usage

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), " ")
)

Arguments

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

Examples

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")

ingmarboeschen/graphing documentation built on Jan. 14, 2025, 7:32 a.m.