0 votes
Error : .onLoad failed in loadNamespace() for 'betfair', details:
  call: contrib.url(repos, type)
  error: trying to use CRAN without setting a mirror

Also getting this warnings:

1: In utils:::packageDescription(x) : no package 'bitops' was found
2: In utils:::packageDescription(x) : no package 'zoo' was found
3: In utils:::packageDescription(x) : no package 'xts' was found
4: In utils:::packageDescription(x) : no package 'iterators' was found
5: In utils:::packageDescription(x) : no package 'foreach' was found
6: In utils:::packageDescription("RCurl") : no package 'RCurl' was found

I'm using fedora 15 and R 2.13.1 which I installed from repos.
in betfaiR package by dsel Plater (120 points)

1 Answer

+1 vote
It looks from the above error message that you tried to install the betfaiR package using CRAN, whereas it should be installed locally.  There's no R command history (just error output) so one can't be sure what sort of installation procedure has been attempted here.

Try the instructions in Chapter 2 of the accompanying manual at http://www.betwise.co.uk/betfaiR_ebook.
by betwise2 Novice (390 points)
edited by betwise2
All was done exactly like in manual. After the first try I've installed 'R-bitops' and now error-message looks a little different:

> install.packages("/home/dsel/Documents/BettoR/betfair_1.0.0.tar.gz", repos=NULL)
Installing package(s) into '/home/dsel/R/x86_64-redhat-linux-gnu-library/2.13'
(as 'lib' is unspecified)
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_TIME failed, using "C"
3: Setting LC_MESSAGES failed, using "C"
4: Setting LC_PAPER failed, using "C"
5: Setting LC_MEASUREMENT failed, using "C"
* installing *source* package 'betfair' ...
** R
** preparing package for lazy loading
** help
*** installing help indices
  converting help for package 'betfair'                                                                                                                                                                                                      
    finding HTML links ... done                                                                                                                                                                                                              
    Exchange                                html                                                                                                                                                                                             
    ExchangeAU                              html                                                                                                                                                                                             
    Global                                  html                                                                                                                                                                                             
    betStatus                               html  
    betfair-internal                        html  
    betfair-package                         html  
    betfair_odds                            html  
    cancelBets                              html  
    convertCurrency                         html  
    courseAbbrev                            html  
    filterEvents                            html  
    getAccountFunds                         html  
    getActiveEventTypes                     html  
    getAllCurrencies                        html  
    getAllEventTypes                        html  
    getAllMarkets                           html  
    getBet                                  html  
    getBetHistory                           html  
    getBetLite                              html  
    getCompleteMarketPricesCompressed       html  
    getDetailAvailableMktDepth              html  
    getEvents                               html  
    getInPlayMarkets                        html  
    getLastTimestamp                        html  
    getMUBets                               html  
    getMarket                               html  
    getMarketInfo                           html  
    getMarketPrices                         html  
    getMarketProfitAndLoss                  html  
    getMarketTradedVolumeCompressed         html  
    getSilks                                html  
    keepAlive                               html  
    login                                   html  
    logout                                  html  
    newBet                                  html  
    placeBets                               html  
    plotPrice                               html  
    updateBet                               html  
    updateBets                              html  
** building package indices ...
** testing if installed package can be loaded
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_TIME failed, using "C"
3: Setting LC_MESSAGES failed, using "C"
4: Setting LC_PAPER failed, using "C"
5: Setting LC_MEASUREMENT failed, using "C"
Installing package(s) into '/home/dsel/R/x86_64-redhat-linux-gnu-library/2.13'
(as 'lib' is unspecified)
Error : .onLoad failed in loadNamespace() for 'betfair', details:
  call: contrib.url(repos, type)
  error: trying to use CRAN without setting a mirror
In addition: Warning message:
In utils:::packageDescription("RCurl") : no package 'RCurl' was found
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/home/dsel/R/x86_64-redhat-linux-gnu-library/2.13/betfair'
Warning message:
In install.packages("/home/dsel/Documents/BettoR/betfair_1.0.0.tar.gz",  :
  installation of package '/home/dsel/Documents/BettoR/betfair_1.0.0.tar.gz' had non-zero exit status

Should I manually install 'RCurl'?
Mmm. Normally the packages are pulled in automatically.
Here this seems to be failing, not sure why.  The clue is no doubt in the error message "trying to use CRAN without setting a mirror".  We'll have a look. Meantime you can try manually installing all the dependent packages and hopefully that should get around the problem.
These are the packages that are normally loaded, so try loading manually and let us know if that fixes the problem:
Loading required package: bitops
Loading required package: zoo
Loading required package: xts
Loading required package: iterators
Loading required package: foreach
Loading required package: codetools
Loading required package: RCurl
Yep, needed to set CRAN mirror and install missing packages from there. Now all seems to be working properly.
Cool, thanks for letting us know
...