Package 'recruitR'

Title: A College Sports Recruiting Package
Description: As a college sports recruiting package, recruitR provides users with the access to 247 Composite rankings and recruit information from the CollegeFootballData API.
Authors: Saiem Gilani [aut, cre], Ryan Mann [aut]
Maintainer: Saiem Gilani <[email protected]>
License: MIT + file LICENSE
Version: 0.0.3
Built: 2026-10-12 15:51:35 UTC
Source: https://github.com/sportsdataverse/recruitR

Help Index


College Football Conference

Description

This dataframes is used internally to identify conference names and use the abbreviation in the function call for data

Usage

cfb_conf_types_df

Format

A data frame with 11 rows and 4 variables:

id

Referencing conference id

name

Conference name

short_name

Short name for Conference

abbreviation

Conference abbreviation

...

Source

https://api.collegefootballdata.com


Get player recruiting rankings

Description

Get player recruiting rankings

Usage

cfbd_recruiting_player(
  year = NULL,
  team = NULL,
  recruit_type = "HighSchool",
  state = NULL,
  position = NULL
)

Arguments

year

(Integer optional): Year, 4 digit format (YYYY) - Minimum: 2000, Maximum: 2020 currently

team

(String optional): D-I Team

recruit_type

(String optional): default API return is 'HighSchool', other options include 'JUCO' or 'PrepSchool' - For position group information

state

(String optional): Two letter State abbreviation

position

(String optional): Position Group - options include:

  • Offense: 'PRO', 'DUAL', 'RB', 'FB', 'TE', 'OT', 'OG', 'OC', 'WR'

  • Defense: 'CB', 'S', 'OLB', 'ILB', 'WDE', 'SDE', 'DT'

  • Special Teams: 'K', 'P'

Value

cfbd_recruiting_player() - A data frame with 14 variables:

id: integer.

Referencing id - 247Sports.

athlete_id

Athlete referencing id.

recruit_type: character.

High School, Prep School, or Junior College.

year: integer.

Recruit class year.

ranking: integer.

Recruit Ranking.

name: character.

Recruit Name.

school: character.

School recruit attended.

committed_to: character.

School the recruit is committed to.

position: character.

Recruit position.

height: double.

Recruit height.

weight: integer.

Recruit weight.

stars: integer.

Recruit stars.

rating: double.

247 composite rating.

city: character.

Hometown of the recruit.

state_province: character.

Hometown state of the recruit.

country: character.

Hometown country of the recruit.

hometown_info_latitude: character.

Hometown latitude.

hometown_info_longitude: character.

Hometown longitude.

hometown_info_fips_code: character.

Hometown FIPS code.

Examples

try(cfbd_recruiting_player(2018, team = "Texas"))

  try(cfbd_recruiting_player(2016, recruit_type = "JUCO"))

  try(cfbd_recruiting_player(2020, recruit_type = "HighSchool", position = "OT", state = "FL"))

Get college football position group recruiting information.

Description

Get college football position group recruiting information.

Usage

cfbd_recruiting_position(
  start_year = NULL,
  end_year = NULL,
  team = NULL,
  conference = NULL
)

Arguments

start_year

(Integer optional): Start Year, 4 digit format (YYYY). Note: 2000 is the minimum value

end_year

(Integer optional): End Year, 4 digit format (YYYY). Note: 2020 is the maximum value currently

team

(String optional): Team - Select a valid team, D-I football

conference

(String optional): Conference abbreviation - Select a valid FBS conference Conference abbreviations P5: ACC, B12, B1G, SEC, PAC Conference abbreviations G5 and FBS Independents: CUSA, MAC, MWC, Ind, SBC, AAC

Value

cfbd_recruiting_position() - A data frame with 7 variables:

team: character.

Recruiting team.

conference: character.

Recruiting team conference.

position_group: character.

Position group of the recruits.

avg_rating: double.

Average rating of the recruits in the position group.

total_rating: double.

Sum of the ratings of the recruits in the position group.

commits: integer.

Number of commits in the position group.

avg_stars: double.

Average stars of the recruits in the position group.

Examples

try(cfbd_recruiting_position(2018, team = "Texas"))

  try(cfbd_recruiting_position(2016, 2020, team = "Virginia"))

  try(cfbd_recruiting_position(2015, 2020, conference = "SEC"))

Get college football recruiting team rankings information.

Description

Get college football recruiting team rankings information.

Usage

cfbd_recruiting_team(year = NULL, team = NULL)

Arguments

year

(Integer optional): Recruiting Class Year, 4 digit format (YYYY). Note: 2000 is the minimum value

team

(String optional): Team - Select a valid team, D1 football

Value

cfbd_recruiting_team() - A data frame with 4 variables:

year: integer.

Recruiting class year.

rank: integer.

Team Recruiting rank.

team: character.

Recruiting Team.

points: character.

Team talent points.

Examples

try(cfbd_recruiting_team(2018, team = "Texas"))

  try(cfbd_recruiting_team(2016, team = "Virginia"))

  try(cfbd_recruiting_team(2016, team = "Texas A&M"))

  try(cfbd_recruiting_team(2011))

Get Transfer Portal Data

Description

Get Transfer Portal Data

Usage

cfbd_recruiting_transfer_portal(year)

Arguments

year

(Integer required): Year of the offseason (2021 would return transfer portal data starting from the end of the 2020 season), 4 digit format (YYYY).

Value

cfbd_recruiting_transfer_portal() - A data frame with 11 variables:

season:integer

Season of transfer.

first_name:character.

Player's first name.

last_name:character.

Player's last name.

position:character.

Player position.

origin:character.

original team.

destination:character.

new team.

transfer_date:character.

Date of transfer.

rating:character.

Player's 247 transfer rating.

stars:integer

Player's star rating.

eligibilty:character.

Player's eligibilty status.

Examples

try(cfbd_recruiting_transfer_portal(year = 2021))

Get team rosters

Description

Get a teams full roster by year. If team is not selected, API returns rosters for every team from the selected year.

Usage

cfbd_team_roster(year, team = NULL)

Arguments

year

(Integer required): Year, 4 digit format (YYYY)

team

(String optional): Team, select a valid team in D-I football

Value

cfbd_team_roster() - A data frame with 12 variables:

athlete_id: character.

Referencing athlete id.

first_name: character.

Athlete first name.

last_name: character.

Athlete last name.

team: character.

Team name.

weight: integer.

Athlete weight.

height: integer.

Athlete height.

jersey: integer.

Athlete jersey number.

year: integer.

Athlete year.

position: character.

Athlete position.

home_city: character.

Hometown of the athlete.

home_state: character.

Hometown state of the athlete.

home_country: character.

Hometown country of the athlete.

home_latitude: numeric.

Hometown latitude.

home_longitude: number.

Hometown longitude.

home_county_fips: integer.

Hometown FIPS code.

headshot_url: character

Player ESPN headshot url.

Examples

try(cfbd_team_roster(year = 2013, team = "Florida State"))

Get composite team talent rankings for all teams in a given year

Description

Extracts team talent composite as sourced from 247 rankings

Usage

cfbd_team_talent(year = NULL)

Arguments

year

(Integer optional): Year 4 digit format (YYYY)

Value

cfbd_team_talent() - A data frame with 3 variables:

year: integer.

Season for the talent rating.

school: character.

Team name.

talent: double.

Overall roster talent points (as determined by 247Sports).

Examples

try(cfbd_team_talent())

  try(cfbd_team_talent(year = 2018))

CFBD Venues Endpoint Overview

Description

Pulls all college football venues and data on capacity, grass, city/state, location, elevation, dome, timezone and construction year.

Usage

cfbd_venues()

Details

CFB Venue Information

 cfbd_venues()

Value

A data frame with 337 rows and 13 variables:

venue_id:integer.

Referencing venue ID.

name:character.

Venue name.

capacity:integer.

Stadium capacity.

grass:logical.

TRUE/FALSE response on whether the field is grass or not (oh, and there are so many others).

city:character.

Venue city.

state:character.

Venue state.

zip:character.

Venue zip.

country_code:character.

Venue country code.

location:list.

Venue location.

elevation:character.

Venue elevation.

year_constructed:integer.

Year in which the venue was constructed.

dome:logical.

TRUE/FALSE response to whether the venue has a dome or not.

timezone:character.

Time zone in which the venue resides (i.e. Eastern Time -> "America/New York").

Examples

try(cfbd_venues())

Load .csv / .csv.gz file from a remote connection

Description

This is a thin wrapper on data.table::fread

Usage

csv_from_url(...)

Arguments

...

passed to data.table::fread


Load .rds file from a remote connection

Description

Load .rds file from a remote connection

Usage

rds_from_url(url)

Arguments

url

a character url

Value

a dataframe as created by readRDS()


CFBD API Key Registration

Description

Save your API Key as a system environment variable CFBD_API_KEY

Usage

cfbd_key()

has_cfbd_key()

Details

To get access to an API key, follow the instructions at https://collegefootballdata.com/key

Using the key:
You can save the key for consistent usage by adding CFBD_API_KEY=XXXX-YOUR-API-KEY-HERE-XXXXX to your .Renviron file (easily accessed via usethis::edit_r_environ()).
Run usethis::edit_r_environ(), a new script will pop open named .Renviron, THEN
paste the following in the new script that pops up (without quotations)

CFBD_API_KEY = XXXX-YOUR-API-KEY-HERE-XXXXX

Save the script and restart your RStudio session, by clicking Session (in between Plots and Build) and click ⁠Restart R⁠
(there also exists the shortcut Ctrl + Shift + F10 to restart your session).

If set correctly, from then on you should be able to use any of the cfbd_ functions without any other changes.

For less consistent usage:
At the beginning of every session or within an R environment, save your API key as the environment variable CFBD_API_KEY (with quotations) using a command like the following.

Sys.setenv(CFBD_API_KEY = "XXXX-YOUR-API-KEY-HERE-XXXXX")

Get 247 CFB Player Recruiting Rankings

Description

Get 247 CFB Player Recruiting Rankings

Usage

tfs_recruiting_rankings(year, recruit_type = "HighSchool", pages = 5)

Arguments

year

(Integer optional): Year, 4 digit format (YYYY) - Minimum: 2000, Maximum: 2020 currently

recruit_type

(String optional): default API return is 'HighSchool', other options include 'JUCO' or 'PrepSchool' - For position group information

pages

Number of pages

Value

tfs_recruiting_rankings()

Examples

try(tfs_recruiting_rankings(2022))

Get 247 Recruitment

Description

Get 247 Recruitment

Usage

tfs_recruitment(recruitment_id)

Arguments

recruitment_id

(Integer)

Value

tfs_recruitment()

Examples

tfs_recruitment(recruitment_id = 130361)