makeUrls | R Documentation |
This is a convenience function (used by scrape) which constructs urls with the common Gameday root http://gd2.mlb.com/components/game/mlb/.
makeUrls(start, end, gids = "infer")
start |
date "yyyy-mm-dd" to commence scraping. |
end |
date "yyyy-mm-dd" to terminate scraping. |
gids |
The default value "infer" suggests gameday_links should be derived
and appended appropriately (based on values of |
Returns a character vector.
# XML file names with pitch-by-pitch level data
prefix <- makeUrls(start="2011-04-04", end="2011-04-04")
paste0(prefix, "/inning/inning_all.xml")
# XML file names with hit location data
paste0(prefix, "/inning/inning_hit.xml")
# XML file names with game-by-game level data
paste0(makeUrls(start="2011-04-04", end="2011-04-04", gids=""), "/miniscoreboard.xml")
# Use gids option instead
data(gids)
identical(prefix, makeUrls(gids=gids[grep("2011_04_04", gids)]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.