circ_col_chart: Circular Column Chart

View source: R/circ_col_chart.R

circ_col_chartR Documentation

Circular Column Chart

Description

Create a circular column chart.

Usage

circ_col_chart(
  player_data,
  ring_scale,
  ring_inner,
  ring_middle,
  ring_outer,
  ringlab_inner,
  ringlab_middle,
  ringlab_outer,
  col_pal,
  chart_title,
  chart_subtitle,
  chart_source,
  cc_chart_filename
)

Arguments

player_data

a data frame with a player column and a data column.

ring_scale

a numeric value that represent the value the y axis is scaled by.

ring_inner

a numeric value that represents where the inner ring label will be placed on the graph.

ring_middle

a numeric value that represents where the middle ring label will be placed on the graph.

ring_outer

a numeric value that represents where the outer ring label will be placed on the graph.

ringlab_inner

a char value that represents the label of the inner ring.

ringlab_middle

a char value that represents the label of the middle ring.

ringlab_outer

a char value that represents the label of the outer ring.

col_pal

a color palette whose length is the same as the number of players in the data set.

chart_title

is a char value that represents the title of the radar chart.

chart_subtitle

is a char value that is a written explanation of the information shown on the chart.

chart_source

is a char value that represents information about the data, and visualzation.

cc_chart_filename

is a char value that represents the name the chart file will be saved under.

Value

A .png file of the total points scored by an NBA team in the current season over a certain value.

Examples

player_data_01 <- data.frame(player = c("DA", "CP3", "CJ", "DB", "MB","CP"),
                             data = c(978, 942, 797, 1789, 1135, 613))
circ_col_chart(player_data = player_data_01,
               ring_scale = 500,
               ring_inner = 600,
               ring_middle = 1100,
               ring_outer = 1600,
               ringlab_inner = "500",
               ringlab_middle = "1000",
               ringlab_outer = "1500",
               col_pal = c("#1D1160", "#813840", "#63727A", "#723010", "#000000", "#F9AD1B"),
               chart_title = c("Example Shot Plot"),
               chart_subtitle = c("This visualization is an example."),
               chart_source = c("\n\n Source: Here \nLink to Data: here"),
               cc_chart_filename = c("example_plot_01.png"))

player_data_02 <- data.frame(player = c("JM", "DA", "MB", "JC", "DB", "BB", "CP"),
                             data = c(81, 40, 36, 30, 26, 26, 20))
circ_col_chart(player_data = player_data_02,
               ring_scale = 25,
               ring_inner = 35,
               ring_middle = 65,
               ring_outer = 85,
               ringlab_inner = "25",
               ringlab_middle = "50",
               ringlab_outer = "75",
               col_pal = c("#1D1160", "#A24535", "#813840", "#63727A", "#723010", "#000000", "#F9AD1B"),
               chart_title = c("Example Block Plot"),
               chart_subtitle = c("This visualization is an example."),
               chart_source = c("\n\n Source: Here \nLink to Data: here"),
               cc_chart_filename = c("example_plot_02.png"))

rbolt13/NBAcharts documentation built on April 16, 2022, 3:06 p.m.