It won't necessarily be pretty but you can do it like this:
library(tidyverse)
#> Warning: package 'tidyverse' was built under R version 4.1.3
#> Warning: package 'ggplot2' was built under R version 4.1.3
#> Warning: package 'tibble' was built under R version 4.1.3
#> Warning: package 'tidyr' was built under R version 4.1.3
#> Warning: package 'readr' was built under R version 4.1.3
#> Warning: package 'dplyr' was built under R version 4.1.3
library(tsibble)
#> Warning: package 'tsibble' was built under R version 4.1.3
#>
#> Attaching package: 'tsibble'
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, union
library(lubridate)
#> Warning: package 'lubridate' was built under R version 4.1.3
#>
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:tsibble':
#>
#> interval
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
# Toy Data-------------
set.seed(123)
date <- seq(ymd("20190101"), ymd("20220430"), by = "1 day")
df <- tibble(date = date) %>%
mutate(week = yearweek(date)) %>%
distinct(week) %>%
mutate(
profit = row_number()*5 + rnorm(174, 100, 100),
year = isoyear(week),
week2 = isoweek(week)
)
df %>%
mutate(year=as.factor(year)) %>%
ggplot(aes(x = week2, y = profit, color = year, group=year)) +
geom_line() +
scale_x_continuous(breaks=1:53)