search for: statuscolor

Displaying 1 result from an estimated 1 matches for "statuscolor".

2010 Sep 23
4
Simple categorical scatter plot
...me, probably because I don't quite have a handle on either functions or value mapping syntax. ---------- time <- c(1, 2, 3, 7,10,11,14,16,20) pressure <- c(0,10,20,20,50,18,60,65,90) status <- c(0, 0, 1, 1, 1, 0, 3, 3, 3) measures <- c(time,pressure,status) attach(measures) statusColor <- function (x) { if (x==0) return ("green") if (x==1) return ("orange") if (x==2) return ("pink") if (x==3) return ("red") } par(mfrow=c(3,2)) plot(time,pressure,type="l") plot(time,pressure,type="l") plot(time,pressure,type=&...