我是R的新手,当我跟随另一个人的剧本时,我因为无法安装(和回忆)&#34而陷入困境;预测"图书馆。 我已经阅读了其他帖子,但到目前为止似乎没有成功的解决方案。
一些信息:
我只是尝试安装软件包"预测"从平常 服务器(意大利)和我安装后我终于收到了这条消息:
打包'预测'已成功解包且已检查MD5总和
下载的二进制包在 C:\用户\" MYNAME" \应用程序数据\本地\ TEMP \ RtmpYjiY2w \ downloaded_packages
但是,当我插入:[Hours Worked]
时,它会将此返回给我:
library(forecast)
希望你能帮助我。
答案 0 :(得分:3)
通常问题是因为卷曲。 尝试安装或更新当前版本的Curl。 在Linux Ubuntu中使用:
sudo apt-get install libcurl4-openssl-dev libxml2-dev
答案 1 :(得分:1)
我建议使用install.packages("package_name")
安装其他R套餐。 install.packages()
负责处理其他包的依赖关系(例如您的scales
)并避免此类问题。
install.packages("forecast")
library(forecast)
答案 2 :(得分:1)
您可以尝试以下方法-首先安装MASS软件包,然后安装依赖关系为TRUE的“ forecast”。并从不需要编译的源安装。
install.packages(“ MASS”)
install.packages('forecast',dependencies = TRUE)
图书馆(预测)
您是否要从源代码安装需要编译的软件包? (是/否/取消)否
这对我有用。
答案 3 :(得分:0)
正在运行@ ottlngr' answer
install.packages("forecast", repos="http://cran.us.r-project.org")
library(forecast)
...我收到了这样的错误:
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/home/username/R/x86_64-pc-linux-gnu-library/3.4/curl’
ERROR: dependency ‘curl’ is not available for package ‘TTR’
* removing ‘/home/username/R/x86_64-pc-linux-gnu-library/3.4/TTR’
ERROR: dependencies ‘TTR’, ‘curl’ are not available for package ‘quantmod’
* removing ‘/home/username/R/x86_64-pc-linux-gnu-library/3.4/quantmod’
ERROR: dependency ‘quantmod’ is not available for package ‘tseries’
* removing ‘/home/username/R/x86_64-pc-linux-gnu-library/3.4/tseries’
ERROR: dependency ‘tseries’ is not available for package ‘forecast’
* removing ‘/home/username/R/x86_64-pc-linux-gnu-library/3.4/forecast’
The downloaded source packages are in
‘/tmp/Rtmp5kDaem/downloaded_packages’
Warning messages:
1: In install.packages("forecast") :
installation of package ‘curl’ had non-zero exit status
2: In install.packages("forecast") :
installation of package ‘TTR’ had non-zero exit status
3: In install.packages("forecast") :
installation of package ‘quantmod’ had non-zero exit status
4: In install.packages("forecast") :
installation of package ‘tseries’ had non-zero exit status
5: In install.packages("forecast") :
installation of package ‘forecast’ had non-zero exit status
正在运行@ Amirkhm' answer
sudo apt-get install libcurl4-openssl-dev
...似乎有效,能够安装forecast
并导入库而不会出错。
答案 4 :(得分:0)
要在Ubuntu上安装软件包,请按照以下步骤操作: 更新openssl(卷曲更新)和libxml(GNOME XML库的开发文件),
sudo apt-get install libcurl4-openssl-dev libxml2-dev
然后安装具有相关性的软件包:
install.packages('forecast', dependencies = TRUE)
这在ubuntu 16.04上对我有用