Home > front end >  ggplot not rendering plot correctly
ggplot not rendering plot correctly

Time:01-22

I have used a simple CSV table and made a plot with the desired colors and dots, but I cannot find the solution to connect the dots with a line.

#----Import data----#
DS <- read_csv("https://raw.githubusercontent.com/Iqbalpr/Tugas-Kuliah--UIN/main/Data Skripsi Gender + Negara (CSV).csv")
View(DS)
ncol(DS)
nrow(DS)

#----Check and convert column type----#
str(DS) # Check Column
DS$ID <- as.factor(DS$ID )
DS$Gender <- as.factor(DS$Gender)
DS$Tahun <- as.integer(DS$Tahun)
DS$Inflasi <- as.numeric(DS$Inflasi)
DS$Pengangguran <- as.numeric(DS$Pengangguran)
DS$`GDP growth rate` <- as.numeric(DS$`GDP growth rate`)
DS$`GDP per Capita` <- as.numeric(DS$`GDP per Capita`)
str(DS) # Check Column Again

#----Plot----#
p <- ggplot(DS)   aes(x = Tahun, y = AHH, group = Negara, color = Negara)   geom_point()
p

enter image description here

  • Related