Description Usage Arguments Details Value
formatDfByPlayer returns a dataframe formatted to visualize stats across players
1 | formatDfByPlayer(dt, match, nStats, dStats, statName, xStat, valType, players)
|
dt |
A dataframe of stats, eg. a Sportscode matrix output. |
match |
(optional) A string. Indicates the game of interest. |
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 |
players |
A vector of strings. Specifies the names of the players for whom to pull stats. |
This function returns a formatted dataframe for visualizing data when comparing stats across players
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.