Description Usage Arguments Details Value
formatDf returns a dataframe formatted to visualize aggregated column stats
1 2 3 4 5 6 7 8 9 10 11 |
dt |
A dataframe of stats, eg. a Sportscode matrix output. |
match |
(optional) A string. Indicates the game of interest. |
rowStat |
(optional) A string. Indicates the specific row of interest. |
statTeam |
(optional*) A string. Indicates the team for which the user wants to pull the stats. - *if the user does not pass in a rowStat, they must pass in a statTeam |
nStats |
A vector of strings. Indicate the columns used to calculate the aggregated value, or the numerator of a ratio when dStats are also passed in. |
dStats |
(optional) A vector of strings. Indicate the columns used to calculate the denominator of a ratio. |
statName |
A string. Indicates the formatted stat name for the plot. |
xStat |
(optional) A string. Adds a stat column to the dataframe; for plots that use the stat variable along the x axis. |
valType |
(optional) A string. Indicates how to calculate the stat value and set the stat label for the plot |
This function returns a formatted dataframe for visualizing data when the column stats are aggregated together (eg. summed, used to calculate a ratio, etc.).
If all parameters are valid for the input dataframe, then the output will be a formatted dataframe.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.