inst/doc/sportsR.R

## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
library(sportsR)
library(dplyr)
library(ggplot2)

## ----sportsR-datasets,echo = TRUE,message = FALSE,warning = FALSE,results = 'markup'----


view_datasets_sportsR()



## ----sportsRA-plot, fig.width=6, fig.height=4, out.width="100%"---------------


ggplot(pga_results, aes(x = pos, y = sg_total)) +
  geom_point(alpha = 0.5, size = 2) +
  geom_smooth(
    method = "loess",
    se = TRUE
  ) +
  scale_x_reverse() +
  labs(
    title = "Strokes Gained: Total vs. Tournament Position",
    subtitle = "PGA Tour Results",
    x = "Final Position",
    y = "Strokes Gained: Total"
  ) +
  theme_minimal(base_size = 12)

Try the sportsR package in your browser

Any scripts or data that you put into this service are public.

sportsR documentation built on Aug. 27, 2026, 1:08 a.m.