【问题标题】:R-Studio & R Continuously Fail To Install PackagesRStudio 和 R 连续安装包失败
【发布时间】:2014-10-30 23:41:18
【问题描述】:

我正在尝试学习如何在财务中使用 R,并且我正在尝试安装一个软件包,但不断收到以下错误。我现在已经尝试使用 R 3.0.3 从每个版本到当前版本,但仍然是相同的错误。有人向我证实,安装在 3.1.0 上对他们有效,所以我希望这里的人可能对下一步尝试什么有一些意见,因为此时我真的没有想法和搜索查询。

> install.packages("quantstrat", repos="http://R-Forge.R-project.org")
Warning in install.packages :
  cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
  cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
  unable to access index for repository http://R-Forge.R-project.org/bin/macosx/contrib/3.1

   package ‘quantstrat’ is available as a source package but not as a binary

Warning in install.packages :
  package ‘quantstrat’ is not available (for R version 3.1.0)

编辑:按照我尝试输入的以下 cmets 中的建议:

install.packages("quantstrat", repos="http://R-Forge.R-project.org", type="source")

下载少量文件后仅产生这条神秘消息:

* installing *source* package ‘zoo’ ...
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include    -fPIC  -mtune=core2 -g -O2  -c coredata.c -o coredata.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include    -fPIC  -mtune=core2 -g -O2  -c init.c -o init.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include    -fPIC  -mtune=core2 -g -O2  -c lag.c -o lag.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -L/usr/local/lib -o zoo.so coredata.o init.o lag.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/libs
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (zoo)
* installing *source* package ‘xts’ ...
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c add_class.c -o add_class.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c any.c -o any.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c attr.c -o attr.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c binsearch.c -o binsearch.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c coredata.c -o coredata.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c diff.c -o diff.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c dimnames.c -o dimnames.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c endpoints.c -o endpoints.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c extract_col.c -o extract_col.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c init.c -o init.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c isOrdered.c -o isOrdered.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c isXts.c -o isXts.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c leadingNA.c -o leadingNA.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include"   -fPIC  -mtune=core2 -g -O2  -c merge.c -o merge.o
gfortran-4.2 -arch x86_64   -fPIC  -g -O2  -c period.max.f -o period.max.o
make: gfortran-4.2: No such file or directory
make: *** [period.max.o] Error 1
ERROR: compilation failed for package ‘xts’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/xts’
Warning in install.packages :
  installation of package ‘xts’ had non-zero exit status
ERROR: dependency ‘xts’ is not available for package ‘PerformanceAnalytics’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/PerformanceAnalytics’
Warning in install.packages :
  installation of package ‘PerformanceAnalytics’ had non-zero exit status
ERROR: dependency ‘xts’ is not available for package ‘TTR’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/TTR’
Warning in install.packages :
  installation of package ‘TTR’ had non-zero exit status
ERROR: dependencies ‘Defaults’, ‘xts’, ‘TTR’ are not available for package ‘quantmod’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/quantmod’
Warning in install.packages :
  installation of package ‘quantmod’ had non-zero exit status
ERROR: dependencies ‘quantmod’, ‘xts’ are not available for package ‘FinancialInstrument’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/FinancialInstrument’
Warning in install.packages :
  installation of package ‘FinancialInstrument’ had non-zero exit status
ERROR: dependencies ‘xts’, ‘FinancialInstrument’, ‘PerformanceAnalytics’, ‘quantmod’ are not available for package ‘blotter’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/blotter’
Warning in install.packages :
  installation of package ‘blotter’ had non-zero exit status
ERROR: dependencies ‘xts’, ‘TTR’, ‘blotter’, ‘FinancialInstrument’ are not available for package ‘quantstrat’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/quantstrat’
Warning in install.packages :
  installation of package ‘quantstrat’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/q3/0qq1vm5538l657ffhr1hxj6m0000gn/T/RtmpQ5VCcC/downloaded_packages’

提前致谢, 杰森 E.

【问题讨论】:

  • 错误消息说二进制文件不可用(这是默认安装类型)。你试过install.packages("quantstrat", repos="http://R-Forge.R-project.org", type="source")吗?
  • 您似乎没有安装gfortran。你可以从 CRAN 那里得到它。我假设您使用的是 Snow Leopard 版本的 R。如果不是,您需要另一个 fortran 编译器。
  • MrFlick 和 Bhas 的 cmets 的组合奏效了。非常感谢您的帮助!

标签: r installation package rstudio


【解决方案1】:

上述 cmets 的组合是解决方案...

我完整地安装了 xcode,按照我的 gfortran,然后继续输入之前提到的 repos:

install.packages("quantstrat", repos="http://R-Forge.R-project.org", type="source")

【讨论】:

    猜你喜欢
    • 2017-10-28
    • 2021-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多