Re: [R] Plot Coloured Triangle

2008-06-10 Thread Antje
Thank you very much! That's exactly what I need as a starting point :-) Antje Greg Snow schrieb: Here is an example that may get you started: point1 <- c(1.1, 1.7, 255) point2 <- c(2.2, 1.5, 180) point3 <- c(1.8, 2.2, 60) mydf <- as.data.frame( rbind(point1, point2, point3) ) names(mydf) <-

Re: [R] Plot Coloured Triangle

2008-06-09 Thread Greg Snow
Here is an example that may get you started: point1 <- c(1.1, 1.7, 255) point2 <- c(2.2, 1.5, 180) point3 <- c(1.8, 2.2, 60) mydf <- as.data.frame( rbind(point1, point2, point3) ) names(mydf) <- c('x1','x2','red') fit <- lm(red~x1+x2, data=mydf) df2 <- expand.grid( x1=seq(min(mydf$x1), max(mydf