Consider a simple ggplot2 graph
library(ggplot2)
dat <- data.frame(name=c(\"apple\", \"orange\", \"plum\"),value=c(3,8,2),outlier=c(FALSE,TRUE,FALSE))
gg
A simpler way (IMO) to do this is just create a conditional color vector and parse it into axis.text.y
dat <- data.frame(name=c("apple", "orange", "plum"),value=c(3,8,2),outlier=c(FALSE,TRUE,FALSE))
colvec <- character(dim(dat)[1])
colvec <- ifelse(dat$outlier, "red", "black")
library(ggplot2)
ggplot(dat) +
geom_point(data = dat, aes(x=value,y=name)) +
theme(axis.text.y = element_text(colour=colvec))
