getMarketPrices missing off the last runner - bug? or my implementation?

0 votes

 

Hi there,

Thanks for writing the package, enjoying getting to grips with it but came across a strange qwerk.

I'm following the tutorial in the manual looking at horse races.

getMarket seems to work fine and pulls up the expected number of runners. However...

When using getMarketPrices I seem to be getting info for one less runners than are in the race. I've checked on the website that the correct number of runners match up with the getMarket call - so something going wrong with getMarketPrices, or my implementation? Code below. The market ID is for GOODWOOD 4TH AUG - Nassau Stks, so should be useable for a week or so.

Presume the underlying code is calling something outside of R as I can't run the components of getMarketPrices to see what is happening where.

Sample code below, any thoughts would be greatly appreciated!

 

mktID=106109934      #Nassau stakes, 4th Aug
dfIndMkt<-getMarket(mktID)$runners   #push runners and selectionID to a df
dfIndMkt<-data.frame(name=dfIndMkt$name,selectionId=dfIndMkt$selectionId)
dfIndMkt
lsPrices<-getMarketPrices(mktID)$runnerPrices   #push prices to a list - there are not enough 
data.frame(best_back=foreach(i=lsPrices, .combine=c) %do% i$bestPricesToBack[1,4])   #output 

 

asked Jul 25, 2012 in betfaiR package by russbowdrey Novice (220 points)

1 Answer

+1 vote

Yes, it appears there is a bug in getMarketPrices which we haven't had time to fix yet.  

Use getCompleteMarketPricesCompressed in the meantime.  Examples of usage are also in the manual - this function returns more data than getMarketPrices anyway.

 

answered Jul 25, 2012 by colin Frankel (19,280 points)
many thanks, I actually found getDetailAvailableMktDepth (which is a component of getCompleteMarketPricesCompressed?) which was perfect for my needs. Thoughtful little shortcut, thanks.
Have you had a moment to take a look at the missing prices?
...