2

I'm trying to learn how to use R in Finance, and I'm trying to install a package but keep getting the following errors. I've tried now with R 3.0.3 through every version to the current and still the same error. Somebody has confirmed for me that the install worked for them on 3.1.0 so I was hoping somebody here may have some input as to what to try next, as I'm really out of ideas and search queries at this point.

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

Edit: Following the suggestion in the below comments I have tried entering:

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

Which yields only this cryptic message after downloading a handful of files:

* 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’

Thanks In Advance, Jason E.

Jason T. Eyerly
  • 183
  • 1
  • 6
  • 18
  • 1
    The error message says a binary isn't available (which is the default installation type). Did you try `install.packages("quantstrat", repos="http://R-Forge.R-project.org", type="source")`? – MrFlick Sep 06 '14 at 00:40
  • http://stackoverflow.com/questions/11105131/cannot-install-r-forge-package-using-install-packages – GSee Sep 06 '14 at 00:58
  • http://stackoverflow.com/questions/17998543/what-to-do-when-a-package-is-not-available-for-our-r-version – GSee Sep 06 '14 at 01:05
  • It would seem that you don't have `gfortran` installed. You can get it from CRAN. I'm assuming that you are using the Snow Leopard version of R. If not you need another fortran compiler. – Bhas Sep 06 '14 at 05:11
  • A combination of MrFlick and Bhas' comments worked. Thanks so much for your help! – Jason T. Eyerly Sep 06 '14 at 17:53

1 Answers1

4

A combination of the above comments was the solution...

I installed xcode in it's entirety, followed my gfortran, and then proceded to type the repos in as was mentioned before:

install.packages("quantstrat", repos="http://R-Forge.R-project.org", type="source")
Jason T. Eyerly
  • 183
  • 1
  • 6
  • 18