#-- crackers data: connected scatterplot: Analysis by Promotion  ---

library(tidyverse)
crackers.df <- read_csv("./data/chap5/crackers.csv")
sp <- ggplot(data=crackers.df,aes(x=x.pre,y=y.post))
sp + 
  geom_point(shape=16,size=3,aes(color=promotion)) +
  geom_line(aes(color=promotion)) +
  theme_classic() +
  theme(text = element_text(size = 12, colour="black"),
        axis.line = element_line(
          arrow = arrow(type="closed",length = unit(8,'pt')))) + 
  scale_x_continuous(limits = c(15,36)) +
  scale_y_continuous(limits = c(20,46),breaks=seq(20,45,5)) +
  labs(x="\nCracker boxes sold before promotion\n",
       y="\nCracker boxes sold during promotion\n")
ggsave(filename="./images/chap5/cted@scatterplot@promo.pdf", width = 4.5,
       height = 3.8,units = "in")