I wish to do a simple line plot with R on a data.frame that looks something like this:
There should be 4 lines, with each line representing an origin, and the x axis representing the years and the y the number of observations per that year, but I cannot seem to find a correct approach.
I have tried the following:
metadata %>%
+ filter(!is.na(origin)) %>%
+ ggplot(aes(year, colour = origin)) +
+ geom_point(size = 5, alpha = 0.3) +
+ geom_line(stat = "count", aes(group = 1)) +
+ theme_minimal()
Can someone help me figure out what I'm doing wrong?
I also tried doing a multiple line plot where the x is a numeric variable and the y is the count of the previous variable,

I would just count
yearandoriginbefore the plot.Created on 2024-03-07 with reprex v2.0.2