histogram_plot <- function(varnames,binwidth,dataset){
graph <- ggplot(aes(x = varnames),data = dataset)+
geom_histogram(binwidth = binwidth)
return(graph)
}
histgram_plot(viewsCount,50,timeline)+
xlim(c(0,8000))
Code as above, create a new function histogram_plot, and call this function in error. Checked for the variable viewsCount in the timeline data box.
if timeline$viewsCount is passed in, the graph can be drawn normally.