找不到功能" echart"在成功安装recharts包后,在R中

时间:2015-09-24 03:41:59

标签: r

我的代码:

install.packages(
  'recharts',
  repos = c('http://yihui.name/xran', 'http://cran.rstudio.com')
)
library(recharts)
echart(iris, ~Sepal.Length, ~Sepal.Width, series = ~Species)

错误是:

  

错误:无法找到功能" echart"

1 个答案:

答案 0 :(得分:2)

显然,echart包中没有recharts功能,当你安装它时:

install.packages('recharts', repos = c('http://yihui.name/xran', 'http://cran.rstudio.com'))

这将安装0.0.1

的版本recharts
library(recharts)
echart(iris, ~Sepal.Length, ~Sepal.Width, series = ~Species)
Error: could not find function "echart"

但是,如果你安装相同的包:

devtools::install_github("yihui/recharts")

这将安装0.0.3

的版本recharts
library(recharts)
echart(iris, ~Sepal.Length, ~Sepal.Width, series = ~Species)

它有效

enter image description here