Description Usage Arguments Author(s) Examples
Betfair getMarketPrices
1 | getMarketPrices(marketId, currencyCode = list(), service = Exchange)
|
marketId |
marketId |
currencyCode |
currencyCode |
service |
service |
colin@betwise.co.uk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function(marketId, currencyCode=list(), service=Exchange)
{
v <- .bfapi(match.call(), service=service)
z <- .xmlp("errorCode", v)
if(is.null(z)) return(v)
if(z != "OK") return(z)
x <- .xmlp("marketPrices",v)
tags <- c("bspMarket","currencyCode","delay","discountAllowed","lastRefresh","marketBaseRate","marketId","marketInfo","marketStatus","numberOfWinners","removedRunners","runnerPrices")
market <- lapply(as.list(tags), .xmlp, x)
tags <- sub(".*:","",tags)
names(market) <- tags
mrp <- .xml2list(market$runnerPrices)
names(mrp) <- c()
mrp <- lapply(mrp, .xml2list)
mrp <- lapply(mrp, function(x) {x$bestPricesToBack=.xmlarray2dataframe(x$bestPricesToBack);x$bestPricesToLay=.xmlarray2dataframe(x$bestPricesToLay);x})
market$runnerPrices <- mrp
market
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.