### Example: Get All AFL Team Colour Palettes Source: https://jimmyday12.github.io/fitzRoy/reference/get_afl_colour_palettes.html Demonstrates how to fetch all available AFL team colour data. This example is wrapped in `if (FALSE)` to prevent execution during standard package checks. ```r if (FALSE) { # \dontrun{ # Gets all data get_afl_colour_palettes() } # } ``` -------------------------------- ### Install fitzRoy from GitHub Source: https://jimmyday12.github.io/fitzRoy/index.html Install the development version of fitzRoy from GitHub using devtools. ```r # install.packages("devtools") devtools::install_github("jimmyday12/fitzRoy") ``` -------------------------------- ### Example: Get AFL Cookie Source: https://jimmyday12.github.io/fitzRoy/reference/get_afl_cookie.html Demonstrates how to call the get_afl_cookie function and store the returned token. This example is wrapped in a \`\`\`if (FALSE) { \`\`\` block to prevent execution during package checks. ```r if (FALSE) { # \ dontrun{ cookie <- get_afl_cookie() } # } ``` -------------------------------- ### Example: Fetch Betting Odds for Specific Seasons Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_betting_odds_footywire.html Demonstrates how to call fetch_betting_odds_footywire to retrieve data for a specific range of seasons. This example is non-executable by default. ```r if (FALSE) { # \dontrun{ fetch_betting_odds_footywire(2012, 2018) } # } ``` -------------------------------- ### Example: Fetching Current and Historical Player Data Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_player_details.html Demonstrates how to fetch current player data for a specific team and historical player data for a different team and competition. This example requires the `if (FALSE)` wrapper to prevent execution. ```R if (FALSE) { # \dontrun{ # Return data for current Hawthorn players fetch_player_details("Hawthorn") fetch_player_details("Adelaide", current = FALSE, comp = "AFLW") fetch_player_details("GWS", current = TRUE, source = "footywire") } # } ``` -------------------------------- ### Fetch Squiggle Data Examples Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_squiggle_data.html Examples demonstrating how to use fetch_squiggle_data to retrieve different types of data from the Squiggle API, such as sources, tips for a specific round and year, and tips from a particular source and year. These examples are non-executable and require an active internet connection to the Squiggle API. ```R # Return a list of the sources, with ID's sources <- fetch_squiggle_data("sources") ``` ```R # Get tips for Round 1, 2018 tips <- fetch_squiggle_data(query = "tips", round = 1, year = 2018) ``` ```R # Get tips from Squiggle 2019 squiggle <- fetch_squiggle_data(query = "tips", source = 1, year = 2019) ``` -------------------------------- ### Install fitzRoy from CRAN Source: https://jimmyday12.github.io/fitzRoy/index.html Install the released version of fitzRoy from CRAN. ```r install.packages("fitzRoy") ``` -------------------------------- ### Example Usage of get_match_results Source: https://jimmyday12.github.io/fitzRoy/reference/get_match_results.html Demonstrates how to call get_match_results and its replacement fetch_results_afltables. This example is wrapped in a conditional that prevents execution by default. ```r # if (FALSE) { # \dontrun{ get_match_results() # -> fetch_results_afltables() } # } ``` -------------------------------- ### Example: Directly Calling Source-Specific Functions Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_fixture.html Demonstrates the direct usage of source-specific functions to fetch fixture data for a given season and round. ```R # Directly call functions for each source fetch_fixture_afl(2018, round = 9) fetch_fixture_footywire(2018, round = 9) fetch_fixture_squiggle(2018, round = 9) ``` -------------------------------- ### Example Usage of get_fixture Source: https://jimmyday12.github.io/fitzRoy/reference/get_fixture.html Demonstrates how to call get_fixture for a specific season and shows the equivalent call using the recommended fetch_fixture_footywire() function. ```r # if (FALSE) { # \dontrun{ get_fixture(2020) # -> fetch_fixture_footywire(2020) } # } ``` -------------------------------- ### Example: Fetching Fixture Data from Different Sources Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_fixture.html Illustrates how to fetch fixture data for a specific season and round from alternative sources like FootyWire and Squiggle. ```R # Different sources fetch_fixture(2015, round = 5, source = "footywire") fetch_fixture(2015, round = 5, source = "squiggle") ``` -------------------------------- ### Example Usage of get_aflw_cookie Source: https://jimmyday12.github.io/fitzRoy/reference/get_aflw_cookie.html Demonstrates how to call the get_aflw_cookie function. The example is wrapped in a \dontrun{} block, indicating it should not be run automatically during package checks. ```r # if (FALSE) { # \dontrun{ get_aflw_cookie() # -> get_aflw_cookie() } # } ``` -------------------------------- ### Example of get_afltables_stats and its replacement Source: https://jimmyday12.github.io/fitzRoy/reference/get_afltables_stats.html Demonstrates how to call the deprecated get_afltables_stats function and its recommended replacement, fetch_player_stats_afltables. This example is wrapped in a conditional that prevents it from running by default. ```r # if (FALSE) { # \dontrun{ get_afltables_stats() # -> fetch_player_stats_afltables() } # } ``` -------------------------------- ### Example of using get_footywire_stats and its replacement Source: https://jimmyday12.github.io/fitzRoy/reference/get_footywire_stats.html Demonstrates how to call the deprecated get_footywire_stats function and its recommended replacement, fetch_footywire_stats, with a player ID. ```r # if (FALSE) { # \dontrun{ get_footywire_stats(5000) # -> fetch_footywire_stats(5000) } # } ``` -------------------------------- ### Example: Transitioning from get_afl_fixture to fetch_fixture_afl Source: https://jimmyday12.github.io/fitzRoy/reference/get_afl_fixture.html Demonstrates how to call the deprecated get_afl_fixture function and its modern equivalent, fetch_fixture_afl, for retrieving AFL fixture data. ```r # if (FALSE) { # \dontrun{ get_afl_fixture(2020, 1) # -> fetch_fixture_afl(2020, 1, "AFLM") } # } ``` -------------------------------- ### Example Usage of get_aflw_detailed_match_data Source: https://jimmyday12.github.io/fitzRoy/reference/get_aflw_detailed_match_data.html An example demonstrating how to call get_aflw_detailed_match_data with specific IDs and a cookie. This function requires IDs obtained from get_aflw_round_data. ```r if (FALSE) { # \dontrun{ get_aflw_detailed_match_data( "CD_M20172640101", "CD_R201726401", "CD_S2017264", get_aflw_cookie() ) } # } ``` -------------------------------- ### Load Required Libraries Source: https://jimmyday12.github.io/fitzRoy/articles/elo-ratings-example.html Load the fitzRoy, dplyr, elo, and lubridate packages. Ensure these are installed before running. ```r library(fitzRoy) library(dplyr) library(elo) library(lubridate) ``` -------------------------------- ### Example Usage: Update Footywire Stats Source: https://jimmyday12.github.io/fitzRoy/reference/update_footywire_stats.html Demonstrates the usage of update_footywire_stats and its recommended replacement, fetch_player_stats_footywire, for updating stats data. ```r # if (FALSE) { # \dontrun{ update_footywire_stats() # -> fetch_player_stats_footywire(2010:2018) } # } ``` -------------------------------- ### Examples: Fetching Player Stats from Different Sources Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_player_stats.html Illustrates how to fetch player statistics for an entire season using Footywire and demonstrates equivalent direct function calls. Also shows how to fetch data for specific rounds and competitions, and how to use different data sources. ```r # Return data for whole season from footywire fetch_player_stats(source = "footywire") # This is equivalent to fetch_player_stats_footywire() # Currently there is no AFLW data and will return a warning fetch_player_stats(2020, comp = "AFLW", source = "footywire") # Different sources fetch_player_stats(2015, round = 5, source = "footywire") fetch_player_stats(2015, round = 5, source = "fryzigg") # Directly call functions for each source fetch_player_stats_afltables(2020) fetch_fixture_fryzigg(2020) fetch_player_stats_footywire(2020) ``` -------------------------------- ### Example: Fetching 2020 match results with get_footywire_match_results Source: https://jimmyday12.github.io/fitzRoy/reference/get_footywire_match_results.html Demonstrates how to call get_footywire_match_results for a specific season and number of matches. It also shows the equivalent call using the recommended fetch_results_footywire function. ```R # if (FALSE) { # \dontrun{ get_footywire_match_results(2020, 1) # -> fetch_results_footywire(2020, 1) } } ``` -------------------------------- ### Alternative to get_score_progression_raw Source: https://jimmyday12.github.io/fitzRoy/reference/get_score_progression_raw.html This example demonstrates the recommended alternative to the deprecated get_score_progression_raw function. It shows how to fetch match results using fetch_results_afltables(). ```r get_match_results() # -> fetch_results_afltables() ``` -------------------------------- ### Example: Fetching Betting Odds for Specific Seasons Source: https://jimmyday12.github.io/fitzRoy/reference/get_footywire_betting_odds.html Shows how to call the deprecated `get_footywire_betting_odds` function for a given season range and its recommended replacement `fetch_betting_odds_footywire`. ```r # if (FALSE) { # \dontrun{ get_footywire_betting_odds(2017, 2018) # -> fetch_betting_odds_footywire(2017, 2018) } # } ``` -------------------------------- ### Example of using get_fryzigg_stats and its replacement Source: https://jimmyday12.github.io/fitzRoy/reference/get_fryzigg_stats.html Demonstrates how to call get_fryzigg_stats for a specific date range and shows the equivalent call using the newer fetch_player_stats_fryzigg() function. ```R # if (FALSE) { # \dontrun{ get_fryzigg_stats(2020, 2021) # -> fetch_player_stats_fryzigg(2020:2021) } # } ``` -------------------------------- ### Example: Fetching Fixture Data for a Season Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_fixture.html Demonstrates how to retrieve all match data for a given season from the official AFL website. This is equivalent to specifying source = "AFL" or calling fetch_fixture_afl directly. ```R # Return data for whole season from AFL Website fetch_fixture(2020) # This is equivalent to fetch_fixture(2020, source = "AFL") fetch_fixture_afl(2020) ``` -------------------------------- ### Fetch Player Stats from Multiple Sources Source: https://jimmyday12.github.io/fitzRoy/articles/fitzRoy.html Demonstrates fetching player stats from different sources and for specific rounds or competitions. Includes examples for AFL, AFLW, Footywire, and Afltables. ```r stats_afl <- fetch_player_stats(2020, round_number = 11) stats_aflw <- fetch_player_stats(2020, source = "AFL", comp = "AFLW") stats_footywire <- fetch_player_stats(2019, round_number = 1, source = "footywire") stats_afltables <- fetch_player_stats_afltables(1990) ``` -------------------------------- ### Load fitzRoy and dplyr Libraries Source: https://jimmyday12.github.io/fitzRoy/articles/fitzRoy.html Load the necessary libraries for data manipulation and accessing fitzRoy functions. This is a common starting point for most analyses. ```r library(dplyr) library(fitzRoy) ``` -------------------------------- ### AFLW Player Stats Example with Deprecation Note Source: https://jimmyday12.github.io/fitzRoy/reference/get_aflw_player_stats.html Demonstrates how to call the deprecated get_aflw_player_stats function for specific years and provides the equivalent modern call using fetch_player_stats_fryzigg. ```r # if (FALSE) { # \dontrun{ get_aflw_player_stats(2017, 2018) # -> fetch_player_stats_fryzigg(2017:2018, comp = "AFLW") } # } ``` -------------------------------- ### Fetch AFL Ladder Data Source: https://jimmyday12.github.io/fitzRoy/reference/return_ladder.html Demonstrates how to use the return_ladder function to get ladder data for a specific season and round. It also shows the equivalent new fetch_ladder_afltables function. ```r if (FALSE) { # \dontrun{ return_ladder(season = 2020, season_round = 1) # -> fetch_ladder_afltables(2020, 1) } # } ``` -------------------------------- ### Run RStudio Docker Container Source: https://jimmyday12.github.io/fitzRoy/articles/docker-support.html Start a Docker container for RStudio with Fitzroy. It maps port 8787 and requires a password to be set. Access RStudio via http://localhost:8787 with username 'rstudio'. ```bash docker run -d -p 8787:8787 -e PASSWORD={YOUR PASSWORD} --name fitzroy jimmyday12/fitzroy:latest ``` -------------------------------- ### Filter Fixture After Start Date Source: https://jimmyday12.github.io/fitzRoy/articles/elo-ratings-example.html Filter the fetched fixture data to include only matches occurring after a specific date. This is useful for ensuring the fixture data aligns with the intended prediction period. ```r fixture <- fixture %>% filter(Date > "2019-01-01") head(fixture) ``` -------------------------------- ### Get Raw Score Progression Data Source: https://jimmyday12.github.io/fitzRoy/reference/get_score_progression_raw.html This is the usage example for the deprecated get_score_progression_raw function. It shows how to call the function, but notes that it has been deprecated due to inefficiency. ```r get_score_progression_raw() ``` -------------------------------- ### Fetch Coaches Votes for a Specific Round Source: https://jimmyday12.github.io/fitzRoy/articles/aflca-coaches-votes.html Use the `fetch_coaches_votes` function to get coaches' votes for a given season, round number, competition, and team. This example retrieves data for the AFLW Western Bulldogs in 2021. ```r fetch_coaches_votes(season = 2021, round_number = 9, comp = "AFLW", team = "Western Bulldogs") ``` -------------------------------- ### Fetch Lineup from Alternative Sources Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_lineup.html Demonstrates fetching lineup data from alternative sources like 'footywire' or 'squiggle'. Note that not all sources may have lineup data, and a warning may be returned. ```r fetch_lineup(2020, source = "footywire") ``` ```r fetch_lineup(2020, source = "squiggle") ``` -------------------------------- ### Get AFLW Match Data (Deprecated) Source: https://jimmyday12.github.io/fitzRoy/reference/get_aflw_match_data.html Demonstrates the old way of getting AFLW match data and its replacement. Use `fetch_results_afl` for retrieving match results. ```r get_aflw_match_data(start_year = 2017) ``` ```r # if (FALSE) { # \dontrun{ get_aflw_match_data(2020) # -> fetch_results_afl(2020, comp = "AFLW") } # } ``` -------------------------------- ### Fetch Player Stats - Main Function Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_player_stats.html Demonstrates the primary `fetch_player_stats` function for retrieving player data. It shows how to specify the data source. ```r fetch_player_stats( season = NULL, round_number = NULL, comp = "AFLM", source = "AFL", player = NULL, player_id = NULL, match = c("exact", "regex", "fuzzy"), ... ) ``` -------------------------------- ### Get AFL Team Abbreviation Source: https://jimmyday12.github.io/fitzRoy/reference/team_abr_afl.html Use this function to get the AFL API abbreviation for a given team name. Set `return_id` to TRUE to retrieve the team ID instead. ```r team_abr_afl(team, return_id = FALSE) ``` -------------------------------- ### Get Fryzigg Match Stats Source: https://jimmyday12.github.io/fitzRoy/reference/get_fryzigg_stats.html Retrieves match statistics from fryziggafl.net/api/. This function is deprecated and has been replaced by fetch_player_stats_fryzigg(). ```R get_fryzigg_stats(start = 1897, end = as.numeric(format(Sys.Date(), "%Y"))) ``` -------------------------------- ### Fetch All Tips Source: https://jimmyday12.github.io/fitzRoy/articles/using-squiggle-api.html Retrieves all available tip data. This is useful for a comprehensive dataset. ```r fetch_squiggle_data("tips") ``` -------------------------------- ### Fetch AFL Teams Source: https://jimmyday12.github.io/fitzRoy/articles/using-squiggle-api.html Retrieves information about all AFL teams. This is a basic call to get team data. ```r fetch_squiggle_data("teams") ``` -------------------------------- ### Fetch Fixture Data from Multiple Sources Source: https://jimmyday12.github.io/fitzRoy/articles/fitzRoy.html Demonstrates fetching fixture data for a given year from the default AFL source, AFLW, Squiggle, and Footywire sources. ```r fixture_afl <- fetch_fixture(2020) fixture_aflw <- fetch_fixture(2020, round_number = 1, comp = "AFLW") fixture_squiggle <- fetch_fixture_squiggle(2020, round_number = 10) fixture_footywire <- fetch_fixture_squiggle(2018) ``` -------------------------------- ### Internal: Get AFL Team Abbreviation Source: https://jimmyday12.github.io/fitzRoy/reference/index.html Internal function to return the team name abbreviation used by the AFL API. ```R team_abr_afl() ``` -------------------------------- ### Fetch Supercoach Scores Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_scores.html Fetches Supercoach scores for a specified year and rounds. This is an example of how to use the `fetch_scores` function for Supercoach data. ```r fetch_scores(type = "supercoach", year = 2025, rounds = 1:3) ``` -------------------------------- ### Get Basic Match Results Source: https://jimmyday12.github.io/fitzRoy/reference/get_match_results.html Retrieves basic match results for a given season. This function is now deprecated and fetch_results_afltables() should be used instead. ```r get_match_results(season = NULL) ``` -------------------------------- ### Get Upcoming Fixture Source: https://jimmyday12.github.io/fitzRoy/reference/get_fixture.html Retrieves upcoming fixture data for a specified season from footywire.com. This function is deprecated and fetch_fixture_footywire() should be used instead. ```r get_fixture(season = lubridate::year(Sys.Date()), convert_date = FALSE) ``` -------------------------------- ### Get detailed AFLW data Source: https://jimmyday12.github.io/fitzRoy/reference/get_aflw_detailed_data.html Retrieves detailed match data for specified AFLW matches. Requires a vector of match IDs. ```r get_aflw_detailed_data(c("CD_M20172640101", "CD_M20172640102")) ``` -------------------------------- ### Fetch Fixture Data with Competition and Source Source: https://jimmyday12.github.io/fitzRoy/articles/main-fetch-functions.html Fetches fixture data for a specific season, competition, and data source. This allows for more targeted data retrieval. ```r fetch_fixture(season = 2021, comp = "AFLM", source = "AFL") ``` -------------------------------- ### Fetch Match Results from Different Sources Source: https://jimmyday12.github.io/fitzRoy/articles/fitzRoy.html Demonstrates fetching match results from various sources including AFL.com.au (default), Squiggle, and Footywire for specific seasons or rounds. The default source for `fetch_results()` is AFL.com.au. ```r results_afl <- fetch_results(2020, round_number = 11) results_aflw <- fetch_results(2020, comp = "AFLW") results_squiggle <- fetch_results_squiggle(2019, round_number = 1) results_footywire <- fetch_results_footywire(1990) ``` -------------------------------- ### Displaying Data Structure Source: https://jimmyday12.github.io/fitzRoy/articles/using-fryzigg-stats.html Use the `head()` function to display the first few rows and columns of the dataset, providing a glimpse into its structure and content. ```r head(dat) #> # A tibble: 6 × 81 #> venue_name match_id match_home_team match_away_team match_date #> #> 1 MCG 15408 Carlton Richmond 2019-03-21 #> 2 MCG 15408 Carlton Richmond 2019-03-21 #> 3 MCG 15408 Carlton Richmond 2019-03-21 #> 4 MCG 15408 Carlton Richmond 2019-03-21 #> 5 MCG 15408 Carlton Richmond 2019-03-21 #> 6 MCG 15408 Carlton Richmond 2019-03-21 #> # ℹ 76 more variables: match_local_time , match_attendance , #> # match_round , match_home_team_goals , #> # match_home_team_behinds , match_home_team_score , #> # match_away_team_goals , match_away_team_behinds , #> # match_away_team_score , match_margin , match_winner , #> # match_weather_temp_c , match_weather_type , player_id , #> # player_first_name , player_last_name , player_height_cm , … ``` -------------------------------- ### Get AFLW Round Data Source: https://jimmyday12.github.io/fitzRoy/reference/get_aflw_round_data.html Retrieves match data for a given AFLW round ID. Requires a valid cookie obtained from get_aflw_cookie(). ```r if (FALSE) { # \dontrun{ get_aflw_round_data("CD_R201826401", get_aflw_cookie()) } # } ``` -------------------------------- ### Fetch Current Players from Footywire Source: https://jimmyday12.github.io/fitzRoy/articles/player-details.html Get the current list of players for a team from Footywire.com. This is generally a faster operation than fetching all historical players. ```r fetch_player_details("Richmond", source = "footywire", current = TRUE) ``` -------------------------------- ### Fetch Fixture Function Signature Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_fixture.html Shows the default parameters and structure for the main fetch_fixture function. ```R fetch_fixture( season = NULL, round_number = NULL, comp = "AFLM", source = "AFL", ... ) ``` -------------------------------- ### Fetch Player Stats for a Season Source: https://jimmyday12.github.io/fitzRoy/articles/using-fryzigg-stats.html Use `fetch_player_stats_fryzigg()` to get player statistics for a specified season. This function is the primary interface to the Fryzigg API. ```r dat <- fitzRoy::fetch_player_stats_fryzigg(2019) ``` -------------------------------- ### Fetch Ladder Data from Multiple Sources Source: https://jimmyday12.github.io/fitzRoy/articles/fitzRoy.html Demonstrates fetching ladder data using different functions for various sources: default AFL.com.au, Squiggle, and Afltables. Use when data from the default source is unavailable or a specific historical dataset is needed. ```r ladder_afl <- fetch_ladder(2020, round_number = 11) ladder_aflw <- fetch_ladder(2020, comp = "AFLW") ladder_squiggle <- fetch_ladder_squiggle(2019, round_number = 1) ladder_afltables <- fetch_ladder_afltables(1990) ``` -------------------------------- ### Build Docker Image Source: https://jimmyday12.github.io/fitzRoy/articles/docker-support.html Build the Docker image for Fitzroy from the repository root. This command tags the image as 'jimmyday12/fitzroy:latest'. ```bash docker build -t jimmyday12/fitzroy:latest -f docker/rstudio/Dockerfile . ``` -------------------------------- ### Get AFLW Detailed Match Data Function Signature Source: https://jimmyday12.github.io/fitzRoy/reference/get_aflw_detailed_match_data.html This is the function signature for get_aflw_detailed_match_data. It requires match, round, and competition IDs, along with a cookie. ```r get_aflw_detailed_match_data(matchid, roundid, competitionid, cookie) ``` -------------------------------- ### Inspect Player Details Structure Source: https://jimmyday12.github.io/fitzRoy/articles/player-details.html Use `glimpse` to view the structure and column names of the fetched player details data. ```r glimpse(details_aflw) ``` -------------------------------- ### Fetch AFLW Ladder Data with Warnings Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_ladder.html Demonstrates fetching AFLW ladder data from sources that may not support it, resulting in warnings. ```r fetch_ladder(2020, round = 1, comp = "AFLW", source = "afltables") ``` ```r fetch_ladder(2020, round = 1, comp = "AFLW", source = "squiggle") ``` -------------------------------- ### Run R Terminal Docker Container Source: https://jimmyday12.github.io/fitzRoy/articles/docker-support.html Start an interactive R terminal session within a Docker container. Run 'quit()' to exit the container. ```bash docker run -it jimmyday12/fitzroy:latest R ``` -------------------------------- ### Fetch Dream Team Scores Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_scores.html Fetches Dream Team scores for a specified year and rounds. This is an example of how to use the `fetch_scores` function for Dream Team data. ```r fetch_scores(type = "dream_team", year = 2025, rounds = 1:3) ``` -------------------------------- ### Fetch Fixture Data (Squiggle) Source: https://jimmyday12.github.io/fitzRoy/articles/main-fetch-functions.html Fetches fixture data for a given year and round number from the Squiggle source. This is an alternative way to call the fetch_fixture function. ```python fetch_fixture(2021, round_number = 5, source = "squiggle") fetch_fixture_squiggle(2021, round_number = 5) ``` -------------------------------- ### Fetch Computer Model Sources Source: https://jimmyday12.github.io/fitzRoy/articles/using-squiggle-api.html Retrieves information about computer model sources. This call fetches a list of available data sources. ```r fetch_squiggle_data("sources") ``` -------------------------------- ### Fetch Fixture Data from Different Source Source: https://jimmyday12.github.io/fitzRoy/articles/main-fetch-functions.html Retrieves fixture data for a specific season and round from an alternative source ('squiggle'). This highlights that field names and team/venue names can vary between sources. ```r fetch_fixture(2021, round_number = 1, source = "squiggle") ``` ```text #> # A tibble: 207 × 24 #> is_grand_final date hscore ateamid agoals ascore hgoals hteamid localtime #> #> 1 0 2021-03… 103 7 13 91 15 1 2021-03-… #> 2 0 2021-03… 94 16 19 125 14 2 2021-03-… #> 3 0 2021-03… 53 18 10 69 7 4 2021-03-… #> 4 0 2021-03… 91 10 14 92 13 5 2021-03-… ``` -------------------------------- ### Get AFL Team Colour Palettes Source: https://jimmyday12.github.io/fitzRoy/reference/get_afl_colour_palettes.html Retrieves a data frame containing the primary, secondary, and tertiary colours for all AFL teams. The data is hosted on GitHub. ```r get_afl_colour_palettes() ``` -------------------------------- ### Directly Call Source-Specific Fetch Functions Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_results.html Shows how to directly call the individual fetch functions for AFL, Footywire, AFL Tables, and Squiggle to retrieve results for a specific season and round. ```r fetch_results_afl(2018, round = 9) ``` ```r fetch_results_footywire(2018, round = 9) ``` ```r fetch_results_afltables(2018, round = 9) ``` ```r fetch_results_squiggle(2018, round = 9) ``` -------------------------------- ### Get AFL Cookie Source: https://jimmyday12.github.io/fitzRoy/articles/womens-stats.html Retrieves the authentication cookie required for accessing AFL data. Ensure this cookie is valid, as it is essential for subsequent data retrieval functions. ```r cookie <- get_afl_cookie() print(cookie) ``` -------------------------------- ### get_aflw_round_data Source: https://jimmyday12.github.io/fitzRoy/reference/get_aflw_round_data.html For a given round ID, get the data for each match played in that round. Use the column `roundId` in the dataframe created by the `get_rounds()` function to specify matches to fetch. ```APIDOC ## Function: get_aflw_round_data ### Description For a given round ID, get the data for each match played in that round. Use the column `roundId` in the dataframe created by the `get_rounds()` function to specify matches to fetch. ### Arguments * **roundid** (string) - Required - A round ID string. * **cookie** (string) - Required - A cookie produced by `get_womens_cookie()`. ### Value A dataframe containing match data. ### Example ```R if (FALSE) { # \dontrun{ get_aflw_round_data("CD_R201826401", get_aflw_cookie()) } ``` ``` -------------------------------- ### Displaying Data Rows Source: https://jimmyday12.github.io/fitzRoy/articles/main-fetch-functions.html This snippet shows a sample of how data rows might be displayed, including row numbers, dates, and various integer and character metrics. It also lists additional variables available in the dataset. ```text #> 5 0 2021-03… 78 15 13 86 11 9 2021-03-… #> 6 0 2021-03… 80 6 8 58 11 11 2021-03-… #> 7 0 2021-03… 65 13 17 117 9 12 2021-03-… #> 8 0 2021-03… 105 3 11 80 15 14 2021-03-… #> 9 0 2021-03… 83 8 8 58 12 17 2021-03-… #> 10 0 2021-03… 85 4 16 106 13 3 2021-03-… #> # ℹ 197 more rows #> # ℹ 15 more variables: abehinds , tz , updated , ateam , #> # complete , winnerteamid , year , hbehinds , #> # venue , hteam , is_final , id , roundname , #> # round , winner ``` -------------------------------- ### Get AFLW Rounds Data Source: https://jimmyday12.github.io/fitzRoy/reference/get_aflw_rounds.html Retrieves a dataframe containing information about each AFLW round, including round IDs for further requests. Requires a valid cookie obtained from get_aflw_cookie(). ```r if (FALSE) { # \dontrun{ get_aflw_rounds(get_aflw_cookie()) } # } ``` -------------------------------- ### Get AFLW Cookie Source: https://jimmyday12.github.io/fitzRoy/reference/get_aflw_cookie.html This function retrieves the necessary cookie for accessing AFLW statistics. It is a replacement for older methods and works for both men's and women's data. ```r get_aflw_cookie() ``` -------------------------------- ### fetch_fixture_footywire Source: https://jimmyday12.github.io/fitzRoy/reference/fetch_fixture.html Directly call function to fetch fixture data from Footywire. ```APIDOC ## fetch_fixture_footywire ### Description Directly call function to fetch fixture data from Footywire. ### Usage ```R fetch_fixture_footywire( season = NULL, round_number = NULL, convert_date = FALSE ) ``` ### Arguments * **season** (numeric) - Season in YYYY format, defaults to NULL which returns the year corresponding the `Sys.Date()` * **round_number** (numeric) - Round number, defaults to NULL which returns latest round * **convert_date** (logical) - If TRUE, converts date column to date format instead of date time. ### Value A Tibble with the fixture from the relevant `season` and `round`. ### Examples ```R if (FALSE) { # \dontrun{ fetch_fixture_footywire(2018, round = 9) } ``` ``` -------------------------------- ### Fetch and Calculate Coach Votes (Coach View) Source: https://jimmyday12.github.io/fitzRoy/reference/calculate_coaches_vote_possibilities.html Fetches coach votes for a specific match and then calculates the vote possibilities for a 'Coach View' output. ```r df <- fetch_coaches_votes(comp = "AFLM", season = 2021, round = 24, team = "Western Bulldogs") calculate_coaches_vote_possibilities(df, "Coach View") ``` -------------------------------- ### Get Final ELO Ratings Source: https://jimmyday12.github.io/fitzRoy/articles/elo-ratings-example.html Retrieves the final ELO ratings for all teams at the end of the dataset. This provides a summary of each team's performance based on the ELO model. ```R final.elos(elo.data) ``` -------------------------------- ### Fetch Fixture Data for a Season Source: https://jimmyday12.github.io/fitzRoy/articles/main-fetch-functions.html Retrieves all fixture data for a given season. This is the most basic usage of the `fetch_fixture` function. ```r fetch_fixture(2021) ``` ```text #> # A tibble: 207 × 55 #> id providerId utcStartTime status compSeason.id compSeason.providerId #> #> 1 2991 CD_M20210140101 2021-03-18T… CONCL… 34 CD_S2021014 #> 2 2986 CD_M20210140102 2021-03-19T… CONCL… 34 CD_S2021014 #> 3 2992 CD_M20210140103 2021-03-20T… CONCL… 34 CD_S2021014 #> 4 2993 CD_M20210140104 2021-03-20T… CONCL… 34 CD_S2021014 #> 5 2994 CD_M20210140105 2021-03-20T… CONCL… 34 CD_S2021014 #> 6 2987 CD_M20210140106 2021-03-20T… CONCL… 34 CD_S2021014 #> 7 2990 CD_M20210140107 2021-03-21T… CONCL… 34 CD_S2021014 #> 8 2989 CD_M20210140108 2021-03-21T… CONCL… 34 CD_S2021014 #> 9 2988 CD_M20210140109 2021-03-21T… CONCL… 34 CD_S2021014 #> 10 2999 CD_M20210140201 2021-03-25T… CONCL… 34 CD_S2021014 #> # ℹ 197 more rows #> # ℹ 49 more variables: compSeason.name , compSeason.shortName , #> # compSeason.currentRoundNumber , round.id , #> # round.providerId , round.abbreviation , round.name , #> # round.roundNumber , round.byes , home.team.id , #> # home.team.providerId , home.team.name , #> # home.team.abbreviation , home.team.nickname , … ``` -------------------------------- ### Fetch Tips for a Specific Round and Year Source: https://jimmyday12.github.io/fitzRoy/articles/using-squiggle-api.html Retrieves tip data filtered by a specific round and year. Useful for analyzing a particular season's tips. ```r fetch_squiggle_data("tips", round = 1, year = 2018) ```