Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- normalize <- function(x) {
- r = range(x)
- m = r[2] - r[1]
- (x - r[1]) / m
- }
- colors = rainbow(8)
- p1 = xyplot(Sepal.Length~Sepal.Width|Species,iris,col=colors[round(normalize(iris$Petal.Length)*7)+1])
- p2 = xyplot(Sepal.Length~Sepal.Width,iris,col=colors[round(normalize(iris$Petal.Length)*7)+1],pch=as.numeric(iris$Species))
- print(c(p1, p2))
Add Comment
Please, Sign In to add comment