找不到Highcharter程序包-Highchart功能不可用 [英] Highcharter package not found - highchart function not available

查看:90
本文介绍了找不到Highcharter程序包-Highchart功能不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 highcharter 软件包绘制一些股票图表.但是,当我使用install.packages和库时,会收到一些错误消息.然后,当我尝试使用 highchart 函数时,出现以下错误消息:

I want to use the highcharter package to chart some stocks. However, I receive some error messages, when I use install.packages and library. When I then try to use the highchart function, I get the following error message:

highchart错误(类型=股票"):找不到函数"highchart".

Error in highchart(type = "stock") : could not find function "highchart".

以下是加载程序包时的错误:

These are the errors while loading the package:

install.packages("highcharter")

尝试URL' https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/highcharter_0.7.0.tgz '

内容类型"application/x-gzip"长度2851784字节(2.7 MB)

Content type 'application/x-gzip' length 2851784 bytes (2.7 MB)

===================================================

==================================================

下载2.7 MB

tar:无法设置默认语言环境

tar: Failed to set default locale

下载的二进制软件包在/var/folders/g7/zltv5nrj1qj0hcmdyql94s3r0000gn/T//RtmpnlCQEr/downloaded_pa​​ckages

The downloaded binary packages are in /var/folders/g7/zltv5nrj1qj0hcmdyql94s3r0000gn/T//RtmpnlCQEr/downloaded_packages

library(highcharter)

错误:在loadNamespace(j<-i [[1L]],c(lib.loc,.libPaths()),versionCheck = vI [[j]])中,"highcharter"的包或名称空间加载失败:没有名为"data.table"的包另外:警告消息:软件包"highcharter"是在R版本3.4.4下构建的

Error: package or namespace load failed for 'highcharter' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called 'data.table' In addition: Warning message: package 'highcharter' was built under R version 3.4.4

此外,当我手动激活"软件包时,它也将无法工作.尝试安装该软件包并选择它,也尝试过:

Also, when I manually "activate" the package, it will not work either. Tried to install the package and select it, also tried:

remove.packages(c("highcharter", "data.table"))
install.packages('highcharter', dependencies = TRUE)
install.packages('data.table', dependencies = TRUE)

也尝试过

highcharter::highchart

这是我现在正在运行的代码:

This is the code I am running now:

# Charting stock prices
hchart(type = "stock") %>% 
  hc_title(text = "monthly log returns") %>% 
  hc_add_series(asset_returns_xts[, symbols[1]], name = symbols[1])

我期望使用highcharter文档中描述的图表,但找不到包和函数.

I have expected a chart as described with the highcharter documentation, instead the package and function is not found.

推荐答案

感谢您的帮助!我需要从计算机上卸载R和RStudio,然后它才能工作.

thank you for your help! I needed to uninstall R and RStudio from my machine and then it worked.

我不确定,为什么,但是它解决了我的问题,一切现在都运行顺利.

I am not entirely sure, why but it solved my issue, everything is running smoothly now.

再次感谢您!

最诚挚的问候,

Bodo

这篇关于找不到Highcharter程序包-Highchart功能不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆