sc_batting_stats: Create statlines that include count and rate metrics for...

View source: R/sc_batting_stats.R

sc_batting_statsR Documentation

Create statlines that include count and rate metrics for players based on Statcast

Description

This function allows you to create statlines of statistics for players or groups of players from raw Statcast. When calculating wOBA, the most recent year in the data frame is used for weighting.

Usage

sc_batting_stats(df, base = "pa")

Arguments

df

A data frame of statistics that includes, at a minimum, the following columns: events, description, game_date, and type.

base

Tells the function what to use as the population of pitches to use for the statline. Options include "swings", "contact", or "pa". Defaults to "pa".

Examples

## Not run: 
sc_batting_stats(df, base = "contact")

## End(Not run)

pontsuyu/mlbR documentation built on March 23, 2023, 6:38 a.m.