I have a data frame called payload from which I am trying to plot batted ball locations. The plot is actually working except each batted ball is supposed to be a certain color based on what kind of result it was. Everything comes up grey and the key states “NA”.
Any ideas? Thanks in advance.
bb_palette <- c('Single' = "#006BA4",
'Double' = "#A2CEEC",
'Triple'= "#FFBC79",
'Home Run'= "#C85200",
'Out/Other' = "#595959")
ggspraychart(payload,
x_value = 'hitData.coordinates.coordX',
y_value = '-hitData.coordinates.coordY',
fill_value = 'batted.ball.result',
fill_palette = bb_palette,
point_size = 3) +
labs(title = 'Batted Balls: Gwinnett Stripers versus the Charlotte Knights',
subtitle = '2019-05-01')
Looking for help here.