My data consists of a numeric (yy) variable and a categorical (xx) variable, as shown below.
xx = c(rep("C", 5), rep("D",5)) yy = rnorm(10, 0, 4) xx1 = as.integer(as.factor(xx)) plot(xx1, yy, ylim = c(-13.5, 4), col="blue") I wish to generate a scatter plot of the data such that instead of 1 it prints C, and instead of 2, it prints D on the x- axis. Could someone help me with an R code on how to go about this. Thank you in advance for your help, JN [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.