library(ggplot2)
DATES <- seq.Date(from = as.Date("2020-08-01"), to = as.Date("2020-08-20"), by = 1)
DF <- data.frame(Date = rep(DATES, each = 2), `Sales Rep` = rep(c("Mike", "Dave"), 10),
Sales = runif(40, 50, 100), check.names = FALSE)
head(DF)
ggplot(DF, aes(x = `Sales Rep`, y = Sales, fill = `Sales Rep`)) + geom_boxplot()
Try using back ticks, `, instead of single quotes, ', around Sales Rep. The back tick key is just to the left of the 1 key on a US keyboard.
Even better, do not use column names with spaces or other non syntactic characters. It causes more trouble than it is worth, I think.
However, the table I have is a little more complex and some names appearing every day, and some don't. Do you recommend me to create a new data frame based on the info of the table or importing should work?