I am just getting started with R and I am trying to plot some dummy data that I made which I have loaded as a dataframe, however, after a lot of trial and error and searching I tried to make a barplot of some of the columns and the following code did not work:
Termcount <- count(dummydata$Term)
ggplot(data=dummydata, aes(x=Term, y=Termcount, fill=Term)) + geom_bar(stat = "identity")
However, the following code did and generated the plot I was after but I can't understand why.
ggplot() + aes(dummydata$Term, fill=dummydata$Term) + geom_bar()
This generates the following plot:
When the first code is run I am presented with the following error:
Don't know how to automatically pick scale for object of type data.frame. Defaulting to continuous. Error: Aesthetics must be either length 1 or the same as the data (17): x, y, fill
If required I can upload the data if that will help.

Termcountcolumn in the dummydata - s.brunel