The example below shows the default scoring rules implemented. The ptsBracket
element is only required if you have a DST
element defined. To create a
custome scoring rule create a list with a data table for each position. Each
data table has two columns dataCol, multiplier
. The dataCol
column
is the name of the scoring variable and multiplier
is the multiplier
to be used for the scoring variable. For example, in the default scoring rule
you can see that passTds
for QB has a multiplier of 4 indicating that
4 points is awarded per passing TD.
1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | scoringRules <- list(
QB = data.table::data.table(dataCol = c("passYds", "passTds", "passInt", "rushYds", "rushTds", "twoPts", "fumbles"),
multiplier = c(1/25, 4, -3, 1/10, 6, 2, -3 )),
RB = data.table::data.table(dataCol = c("rushYds", "rushTds", "rec", "recYds", "recTds", "returnTds", "twoPts", "fumbles"),
multiplier = c(1/10, 6, 0, 1/8, 6, 6, 2, -3)),
WR = data.table::data.table(dataCol = c("rushYds", "rushTds", "rec", "recYds", "recTds", "returnTds", "twoPts", "fumbles"),
multiplier = c(1/10, 6, 0, 1/8, 6, 6, 2, -3)),
TE = data.table::data.table(dataCol = c("rushYds", "rushTds", "rec", "recYds", "recTds", "returnTds", "twoPts", "fumbles"),
multiplier = c(1/10, 6, 0, 1/8, 6, 6, 2, -3)),
K = data.table::data.table(dataCol = c("xp", "fg0019", "fg2029", "fg3039", "fg4049", "fg50"),
multiplier = c(1, 3, 3, 3, 4, 5)),
DST = data.table::data.table(dataCol = c("dstFumlRec", "dstInt", "dstSafety", "dstSack", "dstTd", "dstBlk"),
multiplier = c(2, 2, 2, 1, 6, 1.5)),
DL = data.table::data.table(dataCol = c("idpSolo", "idpAst", "idpSack", "idpInt", "idpFumlForce", "idpFumlRec", "idpPD", "idpTd", "idpSafety"),
multiplier = c(1, 0.5, 2, 3, 3, 2, 1, 6, 2)),
LB = data.table::data.table(dataCol = c("idpSolo", "idpAst", "idpSack", "idpInt", "idpFumlForce", "idpFumlRec", "idpPD", "idpTd", "idpSafety"),
multiplier = c(1, 0.5, 2, 3, 3, 2, 1, 6, 2)),
DB = data.table::data.table(dataCol = c("idpSolo", "idpAst", "idpSack", "idpInt", "idpFumlForce", "idpFumlRec", "idpPD", "idpTd", "idpSafety"),
multiplier = c(1, 0.5, 2, 3, 3, 2, 1, 6, 2)),
ptsBracket = data.table::data.table(threshold = c(0, 6, 20, 34, 99),
points = c(10, 7, 4, 0, -4))
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.