Skip to contents

Get team four-factor and shooting splits from barttorvik.com.

Pulls the season four-factors table (the {year}_fffinal.csv file): effective field goal %, turnover %, offensive/defensive rebound %, free-throw rate, plus 2P/3P/FT shooting splits and assist rates – each paired with its national rank. No API key is required. Data is available from 2008 to present.

Usage

torvik_team_factors(year = most_recent_mbb_season())

Arguments

year

(integer required): Season, in 4-digit ending-year format (e.g. 2024). Defaults to most_recent_mbb_season().

Value

A hoopR_data tibble with one row per team. Each statistic is paired with an interspersed national-rank column (rk, rk_2, ...):

col_nametypesdescription
team_namecharacterTeam name.
e_fg_percentnumericEffective field goal percentage (offense).
e_fg_percent_defnumericEffective field goal percentage allowed (defense).
ftrnumericFree-throw rate (offense).
ftr_defnumericFree-throw rate allowed (defense).
or_percentnumericOffensive rebound percentage.
dr_percentnumericDefensive rebound percentage.
to_percentnumericTurnover percentage (offense).
to_percent_defnumericTurnover percentage forced (defense).
x3p_percentnumericThree-point percentage (offense).
x3p_d_percentnumericThree-point percentage allowed (defense).
x2p_percentnumericTwo-point percentage (offense).
x2p_percent_dnumericTwo-point percentage allowed (defense).
ft_percentnumericFree-throw percentage (offense).
ft_percent_dnumericFree-throw percentage allowed (defense).
x3p_ratenumericThree-point attempt rate (offense).
x3p_rate_dnumericThree-point attempt rate allowed (defense).
aratenumericAssist rate (offense).
arate_dnumericAssist rate allowed (defense).
yearintegerSeason (echoes the year argument).

Examples

# \donttest{
  try(torvik_team_factors(year = 2024))
#> ── Bart Torvik team four factors from barttorvik.com ──────────── hoopR 3.1.0 ──
#>  Data updated: 2026-06-13 07:39:16 UTC
#> # A tibble: 19 × 2
#>    doctype_html_public_w3c_dtd_html_4_01_transitional_en_http_www_w3_org…¹  year
#>    <chr>                                                                   <int>
#>  1 "<HTML><HEAD><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; ch…  2024
#>  2 "<TITLE>ERROR: The request could not be satisfied</TITLE>"               2024
#>  3 "</HEAD><BODY>"                                                          2024
#>  4 "<H1>403 ERROR</H1>"                                                     2024
#>  5 "<H2>The request could not be satisfied.</H2>"                           2024
#>  6 "<HR noshade size=\"1px\">"                                              2024
#>  7 "Request blocked."                                                       2024
#>  8 "We can't connect to the server for this app or website at this time. …  2024
#>  9 "<BR clear=\"all\">"                                                     2024
#> 10 "If you provide content to customers through CloudFront, you can find …  2024
#> 11 "<BR clear=\"all\">"                                                     2024
#> 12 "<HR noshade size=\"1px\">"                                              2024
#> 13 "<PRE>"                                                                  2024
#> 14 "Generated by cloudfront (CloudFront)"                                   2024
#> 15 "Request ID: 9n3X3InmS2FiPCNVDsvaypPLoacTb8a57OxuJtETkLswCtlTHX7rEw=="   2024
#> 16 "</PRE>"                                                                 2024
#> 17 "<ADDRESS>"                                                              2024
#> 18 "</ADDRESS>"                                                             2024
#> 19 "</BODY></HTML>"                                                         2024
#> # ℹ abbreviated name:
#> #   ¹​doctype_html_public_w3c_dtd_html_4_01_transitional_en_http_www_w3_org_tr_html4_loose_dtd
# }