load_holes() files now carry win_prob, win_prob_before, wpa (win
probability added) and skill_rating for every hole of every PGA Tour
stroke play event since 2004.add_win_probability() computes the same columns for an event in progress
or for your own hole data.update_db() builds a local SQLite database (or writes to any DBI
connection) from the hosted data, in one schema: every table has a
season column, ShotLink tables carry both PGA Tour and ESPN IDs, and
dates are text. Later runs add missing seasons and refresh the latest.load_holes() covers 2004 to now (was 2025 to now), including playoff
holes as an extra round.load_player_ids() and load_event_ids() link ESPN IDs to PGA Tour IDs,
so ESPN scoring data joins to ShotLink and strokes gained.load_logos() returns logo image URLs for tours, tournaments, ShotLink
courses and clubs (every host of a men's or women's major, the Ryder Cup,
Presidents Cup or Solheim Cup since 1960), with PGA Tour, ESPN and
ShotLink IDs to join on. Only URLs are provided, not images.load_witb() returns player equipment from the what's in the bag
database (WITBDB): one row per club with head, loft, shaft and grip
specs, parsed from GolfWRX and PGA Tour Club Tracker bag posts, with the
source URL of every bag. load_witb_switches() lists each player's
equipment changes by slot.load_shots() returns every stroke from PGA Tour ShotLink, 2012 to now:
distance, distance to the hole, lie before and after, play-by-play text,
and, in recent seasons, shot coordinates and launch monitor readings
(ball speed, spin, launch angle, apex height).load_tee_times() returns pairings, tee times and starting holes for
every round.load_course_setup() returns par, yardage and pin position by hole and
round.calculate_strokes_gained() scores every shot against a bundled baseline
of expected strokes by lie and distance, fit from ShotLink strokes.summarise_strokes_gained() totals shots by round, tournament or season,
adjusted to the field. Season totals track the PGA Tour's official
strokes gained total closely (correlation 0.97 in 2025 and 0.98 in 2026)
and cover every player in the field, not only those with enough measured
rounds.data argument, so they work
directly on tibbles from load_leaderboard():
player_summary("Scheffler", data = load_leaderboard(2025)).player_name, tournament_id,
score_to_par) and older saved files (display_name, event_id,
score_display) are aligned automatically.save_to_rds() / save_to_parquet() deduplicate on tournament_id as
well as the older event_id column.load_strokes_gained() gains a year argument to filter by season.score_to_par of "E" (even par) is documented.to_par,
field_avg (field scoring average on that hole in that round), vs_field
(strokes vs the field average), and cume_to_par (running tournament score
through each hole, playoff holes included).get_pga_schedule(), get_tournament_leaderboard(),
get_player_scorecards(), load_pga_schedule(), load_pga_leaderboards(),
and load_pga_hbh() are deprecated in favor of load_schedule(),
load_leaderboard(), and load_holes(). They keep working but now warn
once per session.options(golfastr.cache = "filesystem") to keep downloads for 24 hours in
the package cache directory, or "off" to disable caching. The default
("memory") caches for the current session as before.load_leaderboard() and load_holes() now load completed PGA Tour
tournaments from pre-built files hosted on GitHub releases (updated daily)
instead of querying ESPN tournament by tournament. Loading a full season of
leaderboards drops from minutes to seconds, and hole-by-hole data now covers
the full field rather than requiring one API request per player.live argument to bypass the hosted data and fetch
directly from ESPN (e.g., for in-progress tournaments). The live API is
also used automatically as a fallback when hosted data is unavailable.load_holes() output now includes position (final leaderboard standing)
and year columns.data-raw/update_season_data.R pipeline builds and uploads the hosted
files; runs daily via GitHub Actions.load_strokes_gained() with a bundled PGA Tour strokes gained
dataset.tour = "liv".CRAN resubmission with documentation fixes.
@return tags to legacy functions\dontrun{} vs \donttest{} usage in examplesThis release focuses on CRAN compliance and simplifying the storage backend.
save_to_db() and load_from_db() - DuckDB storage has been replaced with simpler file-based storagedb_path parameter now use file_path insteadsave_to_parquet() - Save tournament data to Parquet format for cross-language compatibilityload_from_parquet() - Load tournament data from Parquet filesload_data() - Unified data loading that auto-detects format (.rds or .parquet)build_season() now accepts file_path parameter supporting both .rds and .parquet formatscheck_season() updated to work with file-based storagewin_leaders(), top10_leaders(), tournament_history(), etc.) now use file_path parametertools::R_user_dir() for CRAN compliancecat() calls with message() for suppressible outputarrow package moved to Suggests (optional, only needed for Parquet)Initial release.
load_tournament() - Load leaderboard data for any PGA Tour tournamentload_tournament_detail() - Load tournament with hole-by-hole scorecardsload_holes() - Load hole-by-hole scoring dataload_schedule() - Get tournament schedule for a seasonlist_tournaments() - List available tournamentsget_player() - Look up player results across tournamentsget_winners() - Get tournament winnersget_majors() - Get major championship resultsplayer_summary() - Aggregate player statisticscompare_players() - Side-by-side player comparisonwin_leaders() - Players with most winstop10_leaders() - Players with most top-10 finishesscoring_avg_leaders() - Scoring average leaderboardtournament_history() - Historical results for a tournamentplot_player() - Visualize player finishesplot_leaderboard() - Tournament leaderboard bar chartplot_wins() - Win distribution chartplot_scoring() - Scoring distribution histogramplot_head_to_head() - Compare multiple playerssave_to_rds() / load_from_rds() - RDS file storagebuild_season() - Incrementally build season data filecheck_season() - Check season loading progresscache_info() - View cache statusclear_cache() - Clear cached data