I\'m having some trouble with qplot
in R. I am trying to plot data from a data frame. When I execute the command below the plot gets bunched up on the left si
Your column value
is likely a factor, when it should be a numeric. This causes each categorical value of value
to be given its own entry on the y-axis, thus producing the effect you've noticed.
You should coerce it to be a numeric
data$value <- as.numeric(as.character(data$value))
Note that there is probably a good reason it has been interpreted as a factor and not a numeric, possibly because it has some entries that are not pure numeric values (maybe 1,000
or 1000 m
or some other character entry among the numbers). The consequence of the coercion may be a loss of information, so be warned or cleanse the data thoroughly.
Also, you appear to have the same problem on the x-axis.