Learn R Programming

bpcs (version 1.0.0)

create_predictor_matrix_with_player_lookup_table: Receives a predictor dataframe, a string with the column of the player, a vector of strings with the columns for the predictors and a lookup table and returns an ordered matrix for Stan To be used with the predictors data frame

Description

Receives a predictor dataframe, a string with the column of the player, a vector of strings with the columns for the predictors and a lookup table and returns an ordered matrix for Stan To be used with the predictors data frame

Usage

create_predictor_matrix_with_player_lookup_table(
  d,
  player,
  predictors_columns,
  lookup_table
)

Arguments

d

a data frame of the predictors

player

The name of the column of data data contains the player

predictors_columns

a vector with strings containing the columns for the predictors

lookup_table

a lookup table data frame

Value

A matrix to be used in stan