Here's how you can display all the weeks on x axis.
df %>%
ggplot(aes(x = as.Date(week), y = profit)) +
geom_line() +
scale_x_date(date_breaks = "1 week", # could be 2 weeks or 1 month or anything
labels = scales::date_format(format = "W%W-%y")) +
# rotate labels for visibility
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
The format "W%W-%y" means format like "W12-19".
To display week_other, use the following codes. You need to provide group=1 as explained here.
df %>%
ggplot(aes(x = factor(week_other), y = profit)) +
geom_line(aes(group = 1)) +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
This is my first answer so I can't paste the output here but these work. 