comps: Modeling future performance

Description Usage Arguments Examples

View source: R/comps.R

Description

Modeling future performance

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
comps(
  lahman_id,
  horizon = as.numeric(format(Sys.Date(), "%Y")),
  max_dist = 10000,
  max_num = 100
)

comps_mod_rwar(.data, lahman_id)

comps_mod_salary(.data)

## S3 method for class 'comps'
predict(object, n = 20, ...)

predict_rwar(x, ...)

plot_rwar(x, horizon_years = 5, ...)

plot_comps_universe(x, ...)

plot_salary(x, horizon_years = 5, ...)

dollars_per_rwar()

## S3 method for class 'comps'
plot(x, horizon_years = 5, ...)

Arguments

lahman_id

Lahman ID of the player

horizon

Numeric description of the year from which you want to project

max_dist

Maximum distance allowed for nearest neighbors

max_num

Maximum number of neighbors returned

.data

Passed to the data argument of lm

object

A comps object

n

number of years in advanced to predict. Capped by 24 years of MLB experience.

...

currently ignored

x

A comps object

horizon_years

How many years in advance do you want to forecast?

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
comps("kiescbr01")
comps("kiescbr01", 2000)
comps("piazzmi01")
comps("piazzmi01", 1995)
comps("wrighda03")
comps("wrighda03", 2009)
comps("harpebr03")

## End(Not run)
## Not run: 
predict(comps("beltrca01", 2005))

## End(Not run)
plot_rwar(comps("wrighda03", 2009))
plot_comps_universe(comps("wrighda03", 2009))
plot_salary(comps("wrighda03", 2009))
dollars_per_rwar()
plot(comps("wrighda03", 2009))

beanumber/mlbgm documentation built on Jan. 21, 2020, 8:33 p.m.