I have created a frequency of the values of a vector with the table function and plotted the distribution (over a length of 10).
x <- c(1,3,5,5,6)
plot(table(x), type = "p", pch = 20, xlim = c(1, 10), axes = FALSE)
axis(side = 1, at = c(seq(0, 10, by = 1)))
axis(side = 2)
How can I make this plot with ggplot?
If I create a data frame from the table function, the x axis is not scaled properly (instead the values on the x axis are categorical).
library(ggplot2)
ggplot(as.data.frame(table(x)), aes(x, Freq)) +
geom_point()
Any ideas how to solve this?

as.numeric(x)rather thanxin the aes, and the scale will be continuous.