The key to ordering is to set the levels of the factor in the order you want.
An ordered factor is not required; the extra information in an ordered factor isn't necessary and if these data are being used in any statistical model, the wrong parametrization might result — polynomial contrasts aren't right for nominal data such as this.
## set the levels in order we want
theTable <- within(theTable,
Position <- factor(Position,
levels=names(sort(table(Position),
decreasing=TRUE))))
## plot
ggplot(theTable,aes(x=Position))+geom_bar(binwidth=1)
We simply need to set the factor levels to be in the desired order. There are multiple ways of doing this depending on the situation. For instance, we could do:
levels(theTable$Position) <- c(...)
and simply list the levels in the desired order on the right-hand side. You can also specify the level order within the call factor as above:
theTable$Position <- factor(theTable$Position, levels = c(...))