Is there a way to accomplish this type of faceting in ggplot2 or any other plotting library available in R?
Here is an attempt to create some dummy data.
library(tidyverse)
country <- c(rep("Bahrain", 30), rep("Chile", 30), rep("Czech Rep.", 30))
day <- rep(1:30, 3)
cases <- c(runif(n = 30, 1, 5), runif(n = 30, 5, 10), runif(n = 30, 1, 20)) %>% round()
# trying to create some dummy data
df <- tibble(country, day, cases) %>%
group_by(country) %>%
mutate(cases = cumsum(cases))
# creating a plot with basic faceting
ggplot(df, aes(day, cases)) +
geom_line() +
facet_wrap(~country)