Wednesday, March 2, 2011

R color map

types <- as.factor(c("a","b","b","a"))
c("red","blue")[types]
[1] "red"  "blue" "blue" "red"

No comments: