I want to create a barchart of some data, I collected from a survey using the R programming language. The X values of my data range between 4-10 but I want my xaxis to range between 0-10 to display the full range of variables that my survey could have possibly given.
Data:
X = 4 5 6 7 8 9 10
Y = 5 7 2 10 5 2 5
I have tried:
barplot(data, xlim(0,10),xpd=TRUE)
I've also tried using the 'expand_limits' function in ggplot2 with no avail either. This hasnt done what I expected. I want my graph to range between 0 and 10 with bars only plotted on x values of 4-10.
If someone could help me I'd be really thankful.