I have the following R code for a boxplot. But I keep getting 4 1's, 4 2's and 4 3's on the x asis for which I reall want to relace the 1's by agegroup 1 the 2's by age group 2 etc. And I don't want to replce it 4 times just once. Can anyone help.
boxplot(data.all ~ age.group, data = data.plots, boxwex = 0.5, at = c(1, 4, 7, 10), subset = model.type == 1, col = "yellow", main = "Deviation of Predicted from Actual", xlab = "Age Groups", ylab = "Deviations", xlim = c(0.5, 12), ylim = c(-25, 35)) boxplot(data.all ~ age.group, data = data.plots, add = TRUE, boxwex = 0.5, at = c(1.7, 4.7, 7.7, 10.7), subset = model.type == 2, col = "orange") boxplot(data.all ~ age.group, data = data.plots, add = TRUE, boxwex = 0.5, at = c(2.4, 5.4, 8.4, 11.4), subset = model.type == 3, col = "blue") legend(1, 30, c("regression", "glm", "gam"),fill = c("yellow", "orange", "blue")) -- Thanks, Jim. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.