sc_linear_weights: Generate linear weight values for events using Baseball...

View source: R/sc_linear_weights.R

sc_linear_weightsR Documentation

Generate linear weight values for events using Baseball Savant data

Description

This function allows a user to generate linear weight values for events using Baseball Savant data. Output includes both linear weights above average and linear weights above outs for home runs, triples, doubles, singles, walks, hit by pitches, and outs.

Usage

sc_linear_weights(df, level)

Arguments

df

A data frame generated from Baseball Savant that has been run through the run_expectancy_code function.

level

Whether to calculate linear weights the plate appearance or pitch level. "PA" or "Pitch"

Examples

## Not run: sc_linear_weights(df, level = "PA")

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