2014-09-06 114 views
2

我正在嘗試學習如何在財務中使用R,並試圖安裝軟件包但不斷收到以下錯誤。我已經嘗試了R 3.0.3到每個版本到當前的錯誤。有人已經證實3.1.0版本的安裝對他們有效,所以我希望這裏的某個人可能會對接下來要嘗試的內容有所建議,因爲在這一點上我真的沒有想法和搜索查詢。R-Studio&R連續無法安裝軟件包

> 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) 

編輯:繼在下面的評論中建議,我曾嘗試進入:

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’ 

感謝Advance, Jason E.

+1

錯誤消息說一個二進制ISN」 t可用(這是默認的安裝類型)。你試過'install.packages(「quantstrat」,repos =「http://R-Forge.R-project.org」,type =「source」)'? – MrFlick 2014-09-06 00:40:58

+0

http://stackoverflow.com/questions/11105131/cannot-install-r-forge-package-using-install-packages – GSee 2014-09-06 00:58:35

+0

http://stackoverflow.com/questions/17998543/what-to-do-when-a -package-is-not-available-for-our-r-version – GSee 2014-09-06 01:05:31

回答

4

abo的組合已經被評論的解決方案......

我安裝的Xcode在它的全部,跟着我的gfortran,然後proceded可以鍵入如之前提到的回購協議:

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