#activate the package library(ggplot2) #load the dataframe ID <- 1:200 values <- rnorm(200, mean=65, sd=15) my.dataframe <- data.frame(ID, values) #simple frequency polygon with ggplot() ggplot(my.dataframe, aes(values)) + geom_freqpoly() #simple histogram with ggplot() ggplot(my.dataframe, aes(values)) + geom_histogram() #same frequency polygon but with 60 bins ggplot(my.dataframe, aes(values)) + geom_freqpoly(bins= 60) #same frequency polygon but with binwidth=10 ggplot(my.dataframe, aes(values)) + geom_freqpoly(binwidth= 10) #same frequency polygon but different look ggplot(my.dataframe, aes(values)) + geom_freqpoly(bins= 60, size = 1.5, color = "darkblue", linetype="dotted")