Welcome to the community . Happy to help if you can provide some data and expected output (easiest if you just make a reprex: https://www.tidyverse.org/help/ )
before you pipe it into the ggplot command. Based on the aesthetics you have specified there, it seems that you want to have a different table as the base for your plot.
Okay. I used geom_point(aes(color = confirmed)) + points(x[y >= 600], y[y >= 600], pch = 4, col = "red", cex =2) + labs but it shows no change in the plot, Why?
I am not super familiar with the more advanced possibilities of ggplot2, but you could create a column in which you assign colours to the different points. If you for example want to fill all points above 600 in red and all below in green, you could do something like that:
Alternatively, you could order your data and give the top observations one colour and the other ones another.
The problem with that approach is, that you loose the continuos colour scale that you'd get from aes(colour=confirmed). But I don't know if there is any way to mix continuos and discrete plotting or to overwrite the continuous plotting for selected observations.
So if anyone here has a good suggestion in how to do this, I am as eager as Maninder to hear about it.
Okay thanks @jms. I do tried another way using gghighlight package:
covid <- read.csv(file = 'covid_au_state.csv')
dput(covid)
library(lubridate)
library(dplyr)
library(ggplot2)
covid %>%
mutate(date = dmy(date)) %>%
group_by(date) %>%
summarize(confirmed = sum(confirmed))%>%
ggplot(aes(x =date , y = confirmed)) +
geom_line(aes(color = confirmed), size = 0.80, color= "blue")+
gghighlight(confirmed >= 610, label_key = confirmed, unhighlighted_params = list(colour="orange" ,size = .5)) +
labs(x = 'Date', y = 'New Confirmed cases(every day)',
title = 'Total number of new confirmed cases daily throughout Australia')
However I was thinking to improve this visualization by either redefining the x axis to highlight the dates for max 3 confirmed cases. Is that possible, if yes please suggest some way to highlight the dates as well. I looked over many ways but all functions are for continuous scales.
Yes, but I want to display the date say on x axis:5/08/2020 and y axis: confirmed =717 (highest). User should be able to see the scale value for highest points on both axis.
Unfortunately, I don't know how you could highlight certain values on the axes except maybe by adding a straight line, e.g. gom_line(aes(y=717)).
If you still need help, it is probably best to create a new thread with those questions and include a full reprex, so that others that may be more familiar with ggplot2 can find it easily.