readin: Read in data from multiple years of CFB Stats data

Description Usage Arguments Value Examples

Description

The function accepts a base filename from the CFB Stats data files and a vector containing the years to read the data in. If there are multiple years to read in the years are stacked and an extra variable is added called Year that contains the year of that data row. The package assumes the CFB Stats data are stored in a location with different folders for each year and the name of the folders are YYYY data, e.g. 2009 data/play.csv . The function also replaces column names with a space with a ..

Usage

1
readin(file, yearvec, folder_loc = "~/Documents/CFB Data/")

Arguments

file

The base name of the file to read in.

yearvec

A numeric vector of years of data to read in at once.

folder_loc

The location on your local drive of where the CFB Stats data is stored.

Value

A data frame containing the data file for all years. An additional column has been added with the year of each data row.

Examples

1
2
plays <- readin("play", 2010:2014)
table(plays$Year)

mattmills49/CFBWinProbability documentation built on May 21, 2019, 1:24 p.m.