fixed color/naming bug in R code