I am trying to reproduce a graphic similar to what is used on the California Dashboard for School Accountability in R Shiny. For sake of this example, consider the following data frame:
student <- c("1234", "4321", "5678", "8765")
schools <- c("ABC", "ABC", "XYZ", "XYZ")
DFS_20 <- c(-34.2, -1.5, 2.8, 8.9)
DFS_21 <- c(-13.5, 27.8, 5.4, 3.9)
school_data <- data.frame("student_id" = student, "school_id" = schools, "DFS_2020" = DFS_20, "DFS_2021" = DFS_21, "Delta_DFS" = DFS_21 - DFS_20)
I would like to somehow plot this data on a grid like this:
where you would have a data point in at [x, y] = [4, 1] (with lower left being (0,0) representing student 1234 because their DFS_2021 score is LOW (-13.5) but their year-over-year growth increased significantly (20.7); a point in [x, y] = [4, 3] for student 4321 because their DFS_2021 score is HIGH (27.8) and their year-over-year growth increased significantly (29.3) etc. I want a Bubble chart so that the point increases in size relative to the number of data points within each cell, but I have no idea where to start creating the canvas (with colors) to overlay the data points onto. I know I can translate their scores into lattice points to plot on a 5x5 grid, but to make the grid with the colors is beyond my skillset.