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))代码如上,新建函数 histogram_plot ,调用此函数时报错。已检查 timeline 数据框中存在变量 viewsCount。如果传入的是 timeline$viewsCount 则可以正常绘制图形。
添加回答
举报
0/150
提交
取消