I got this plot using the code below
library(tidyverse)
ggplot(df2, aes(x =Date, y = Sales, color = id))+
geom_line(size = 0.01, alpha = 0.3)+
+fac
Removing the NAs works well:
library(ggplus)
df2 <- df2[!is.na(df2$Sales),]
pdf("C:\\1\\test.pdf", 7, 5)
p <- ggplot(df2, aes(x =Date, y = Sales)) +
geom_line(aes(colour=id),size = 0.01)+
scale_x_date(breaks = seq(as.Date("2001-01-01"),
as.Date("2007-01-01"), by="1 year"),
labels = date_format("%Y"))
facet_multiple(plot = p, facets = 'id', ncol = 2, nrow = 2)
dev.off()
PS: Another option is using the gridExtra package.