The y axis is not in order, I have made three separate data frames and put them into one ggpllot graph. All of the code is as follows for the graph.
library("dplyr")
library("stringr")
library("tidyverse")
library("ggplot2")
spotiify_origional <- read.csv("https://raw.githubusercontent.com/info201a-au2022/project-group-1-section-aa/main/data/charts.csv")
View(spotiify_origional)
spotify_modify <- spotiify_origional %>%
select(name, country, date, position, streams, artists, genres = artist_genres)
spotify_2022 <- spotify_modify %>%
filter(date >= "2022-01-01") %>%
arrange(date) %>%
group_by(date)
spotify_2022_global <- spotify_modify %>%
filter(date >= "2022-09-17") %>%
filter(date <= "2022-09-29") %>%
filter(country == "global") %>%
filter(name == "Blank Space") %>%
arrange(date) %>%
group_by(streams)
spotify_2022_global1 <- spotify_modify %>%
filter(date >= "2022-09-17") %>%
filter(date <= "2022-09-29") %>%
filter(country == "global") %>%
filter(name == "Don't Start Now") %>%
arrange(date) %>%
group_by(streams)
spotify_2022_global2 <- spotify_modify %>%
filter(date >= "2022-09-17") %>%
filter(date <= "2022-09-29") %>%
filter(country == "global") %>%
filter(name == "Levitating (feat. DaBaby)") %>%
arrange(date) %>%
group_by(streams)
View(spotify_2022_global2)
ggplot() +
geom_line(data=spotify_2022_global, aes(x=date, y=streams, group=1), color="red") +
geom_line(data=spotify_2022_global1, aes(x=date, y=streams, group=2), color="blue") +
geom_line(data=spotify_2022_global2, aes(x=date, y=streams, group=3)) +
geom_point()
I have tried slim and reorder functions, maybe I haven't gotten them correct. Thank you so much for helping!