fPercentileBarChart: Ashwin Raman's percentile bar charts

View source: R/fPercentileBarChart.R

fPercentileBarChartR Documentation

Ashwin Raman's percentile bar charts

Description

Each bar denotes the percentile the player is for that respective stat. This is a much better alternative to radar plots.

Usage

fPercentileBarChart(
  dtDataset,
  vcColumnsToIndex,
  dtMetricCategorisation,
  iPlayerId,
  cTitle = NULL,
  nColumnWidthByTwo = 0.25,
  nBufferForTextHorizontal = 0.005,
  nBufferForTextVertical = 0.05,
  vnQuantileMarkers = NULL,
  cForegroundColour = "red",
  cBackgroundColour = "black",
  cFontColour = "white",
  bAddAbsoluteIndicator = F
)

Arguments

vcColumnsToIndex

The non-metric columns in your dataset, these are typically columns like name, age, team, position, etc.

dtMetricCategorisation

A table with metadata about the variables in dtPlayerMetrics. Refer to the dtMetricCategorisation object declared in the library for an example.

iPlayerId

The ID of the player you want visualised

cTitle

The title on the chart

bAddAbsoluteIndicator

Percentiles can be a little misleading if the underlying numbers aren't uniformly distributed. You can use the vertical dimension to add annotations for an indicator of the absolute spread of the values and where this particular player's values fall within that spread.

dtPlayerMetrics

A dataset with one row for each PlayerName, and various metrics about the PlayerName declared in separate columns. Refer to the dtPlayerMetrics dataset packaged with the library for an example

Examples

fPercentileBarChart(
   dtDataset = dtPlayerMetrics,
   vcColumnsToIndex = c('playerId','PlayerName','TeamName'),
   dtMetricCategorisation,
   iPlayerId = 2,
   cTitle = 'Sample'
)

thecomeonman/CodaBonito documentation built on April 24, 2023, 11:41 a.m.