I have the following code written for r shiny. The legend doesn't show up. Is there a better way to have this data plotted? Could you please tell me how to show the legend in the graph?
data <- gsheet2tbl(xxx)
data1 <- data %>%
mutate(Date = dmy(Date))
output$Plot <- renderPlot({
data1 %>% filter(Name == input$Name)%>%
ggplot(aes(x= Date))+
geom_line(aes(y= S_Fast), color= "Blue", show.legend = )+ geom_point(aes(y= S_Fast),size = 3 , col= "Blue")+
geom_line(aes(y= S_Post), color = "Red")+ geom_point(aes(y= Sugar_Post), size = 3 , col = "Red")+
geom_line(aes(y= weight), color = "Brown")+ geom_point(aes(y= weight), size = 3 , col = "Brown")+
labs(title = paste('Details of Test Score for', input$Name),
x = 'Date',
y = 'Test Scores')