I'm trying to produce a simple ggplot2 jitter plot in R. For x values, I have integers between 1 and 100. When I plot this data my x axis start with a value of 1 then goes to 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, etc.
How can I reorder my x axis to create ascending values (eg. 1, 2, 3, 4, 5, ... etc.)?
Here is my code:
data = read.csv('my_data_file', sep"\t")
x_values = data[,1]
y_values = data[,2]
qplot(rank, score, geom="jitter")
EDIT: I should have pointed out that I also have a few non-integer
x values. Ideally, I would like the x axis to ascend by number and then have the non-integer
values appended to the end of the x axis. Any order for the non-integer
values is fine.