大家好,新萌提问。
最近在学习使用R语言。在使用百度ECharts 2的R语言接口recharts生成交互式动态网页时,我使用RStudio可以使用页面按钮保存一张html。但是现在我需要批量处理文件和生成图片,那就需要通过命令保存(否则就太花时间了)。但是我看
http://madlogos.github.io/recharts/index_cn.html#-en 上面没有讲,所以想问问大家。
就是【
> g <- echartr(NULL, type='map_china')%>%
+ setRoam(show=TRUE) %>%
+ addMP(data=newdata3[,c('name', 'value')],
+ symbolSize=4,
+ itemStyle=list(normal=list(borderColor='#87cefa',
+ borderWidth=1,
+ label=list(show=FALSE)
+ ),
+ emphasis=list(borderColor='#1e90ff',
+ borderWidth=5,
+ label=list(show=FALSE)
+ )
+ )) %>%
+ setDataRange(splitNumber=0,
+ valueRange=c(-15, 15),
+ color=c('maroon', 'purple', 'red', 'orange', 'yellow', 'lightgreen')) %>%
+ addGeoCoord(newdata3[,c('name', 'lng', 'lat')]) %>%
+ setTitle('T2 ERR at 8:00')%>%
+ setSeries(hoverable=FALSE,
+ itemStyle=list(normal=itemStyle(borderColor='rgba(100,149,237,1)',
+ borderWidth=0.5,
+ areaStyle=areaStyle(color='#666666')
+ )))
>
> g
】
我就想保存这个变量g到文件中。
谢谢大家了