weather_html<-function(data=data,output=FALSE,path=''){
df<-data[,c('prov','temperature')]
names(df)<-c("prov","temperature")
title<-paste(format(date,"%Y-%m-%d"),"China temperature now",sep="")
ofile<-paste(format(date,"%Y%m%d"),"_day.html",sep="")
df[,1]<-substr(df[,1],0,2)
recharts.eMap <- eMap(df, namevar=1, datavar = 2, title=title)
if(output){ # 输出HTML文件
recharts.eMap$outList[c('chartid','type')]<-NULL
writeLines(unlist(recharts.eMap$outList),paste(path,ofile,sep=''))
}else{ # 在浏览器中打开HTML网页
plot(recharts.eMap)
}
报错:
Error in xy.coords(x, y, xlabel, ylabel, log) :
'x' is a list, but does not have components 'x' and 'y'
7.
stop("'x' is a list, but does not have components 'x' and 'y'")
6.
xy.coords(x, y, xlabel, ylabel, log)
5.
plot.default(recharts.eMap)
4.
plot(recharts.eMap)
3.
plot(recharts.eMap)
2.
weather_html(data, output = FALSE, path = "")
不能plot(recharts.eMap) ,但是查看recharts.eMap,右边的plot窗口有图显示,请问怎么修改~