If you accept a list of only busy points as input in the form you showed, and then you want to create a visualization of busy points with ggplot2 , this approach will work. First, I handle the input, turning it into something that I can easily give ggplot .
Separate the spaces into meaningful coordinates. I kept the original space names for later labeling. The following is all the manipulations used to properly configure the schedule.
cars <- strsplit(d[,1], "(?<=[AZ])", perl=TRUE)
I multiplied aisle by 2 after converting A to 1, B to 2, etc., to create a new variable called aisle.coord . The reason for multiplying by 2 is to set a variable in which each pass can consist of two lines:
Now, plotting:
library(ggplot2) library(grid) # for unit() ggplot(cars, aes(x = aisle.coord %% 2, y = spot)) + geom_tile(width = 0.5, height = 0.8) + facet_grid(~aisle) + geom_text( aes(x = aisle.coord %% 2, y = spot, label = spot.id), color = "white")
This is the head on the chart. Lots of room for you to improve and customize it. Here is another attempt with less effort. However, there is enough room for tuning (for example, you can adjust the schedule so that a full batch appears, and not just a part of the batch to the maximum place: B44):
ggplot(cars, aes(x = aisle.coord %% 2, y = spot)) + geom_tile(width = 0.5, height = 0.8, fill = "orange") + facet_grid(~aisle) + geom_text( aes(x = aisle.coord %% 2, y = spot, label = spot.id), color = "white", size = 4) + annotate("rect", ymin = 0, ymax = max(cars$spot)+0.5, xmin = 0.3, xmax = 0.7, fill = "grey40") + theme(panel.margin.x = unit(0.05, "lines"), plot.background = element_rect("grey40"), panel.background = element_rect("grey40"), panel.grid.minor = element_blank(), axis.title = element_blank(), axis.text = element_blank(), strip.text = element_blank(), strip.background = element_blank()) + scale_y_continuous(breaks = seq(0.5, (max(cars$spot) + 0.5), 1)) + scale_x_continuous(breaks = c(-0.3, 1.3)) + geom_text(data=data.frame(x = 0.5, y = 10, aisle = LETTERS[1:length(unique(cars$aisle))]), aes(x = x, y = y, label = aisle), inherit.aes = FALSE, color = "white")
