powered by
as.fumeric(x, levels = unique(x))
group = c("a","a","b","b") plot(seq_along(group),col=as.fumeric(group))
Run the code above in your browser using DataLab