#activate the package library(ggplot2) #load the dataframe ID <- 1:3 year <- c(2016, 2017, 2018) precipitation <- c(1315.7,1453.1,1229.8) my.dataframe <- data.frame(ID, year, precipitation) #simple bar chart with ggplot() ggplot(my.dataframe, aes(year, precipitation)) + geom_bar(stat="identity") #alternative ggplot(my.dataframe, aes(year, precipitation)) + geom_col() #simple bar chart with qplot() and geom_bar() qplot(year, precipitation, geom="bar") #returns Error: stat_count() must not be used with a y aesthetic. #simple bar chart with qplot() and geom_bar() and stat="identity" qplot(year, precipitation, geom="bar", stat="identity") #Error: stat_count() must not be used with a y aesthetic. #In addition: Warning message: # `stat` is deprecated #simple bar chart with qplot() and geom_col() qplot(year, precipitation, geom="col")