Why when I use facet_wrap with the function below, I get null outputs for the graphs. A picture of what is going on is attached. The graphs are smushed together and I cannot see any data points. What is going on?
I have covered up titles because of confidential.
There will be 100 or so facets.
data <- read.csv(data.csv)
data$DateTime <- as.POSIXct(data$DateTime,format ='%m/%d/%Y %r')
data <- data %>% mutate(Person = ifelse(Person == 1, "Person 1", "Person 2"))
data %>%
filter(Size %in% c('S','M')
) %>%
arrange(LargePerson) %>%
ggplot(aes(x = DateTime,y = Price)) +
geom_point(
aes(colour = Person)) +
scale_colour_manual(values = c("Person 1" = "blue", "Person 2" = "black")) +
facet_wrap(~ID,scales = "free",ncol=2) + labs(x = "Date") +
scale_x_datetime(breaks = date_breaks("2 days"),labels = date_format("%m/%d/%y")) +
theme(axis.text.x = element_text(angle = 90,vjust = 0.5),
legend.position="bottom"
)