plot numeric vector with names as x ticks
You can use function axis()
to add labels. Argument xaxt="n"
inside plot()
will make plot without x axis labels (numbers).
plot(quantity,xaxt="n")
axis(1,at=1:3,labels=names(quantity))
Do you look for barplot
?
barplot(quantity)
And another option using lattice
:
library(lattice)
barchart(quantity)