包图表中未找到功能echartR

时间:2018-11-03 09:59:33

标签: r

当我运行函数“ echartR”时收到“找不到函数“ echartr””。 任何可以帮助我的人,我都尝试过很多次。 这是我的代码:

require(devtools)
devtools::install_github('cosname/recharts')
library(recharts)
## basic plot 01 sccatter plot
echartr(iris, x=Sepal.Width, y=Petal.Width, series=Species)

2 个答案:

答案 0 :(得分:0)

echartr不是recharts包的功能。
如果需要绘制散点图,请使用以下方法:

library(recharts)
ePoints(iris, xvar=~Sepal.Width, yvar=~Petal.Width, series=~Species)

enter image description here

答案 1 :(得分:0)

echartr是recharts2软件包的功能。 https://github.com/madlogos/recharts2

重新安装图表,调用库并重新运行代码,或尝试下面的示例代码。

devtools::install_github('madlogos/recharts')
library(recharts)
titanic <- data.table::melt(apply(Titanic, c(1, 4), sum))
names(titanic) <- c('Class', 'Survived', 'Count')
echartr(titanic[titanic$Survived == 'Yes', ], Class, Count) %>%
setTitle('Titanic: N Survival by Cabin Class')

,结果将类似于 Your Bar/Column Chart is nice and shiny