gghighlight point help

So I have a database where I compiled some recent NFL statistics called Team_Records. I am plotting each team's "SRS" by year. The below graph gets me a great gghighlight of each team that has a SRS above 2.

ggplot(Team_Records, aes(Year, SRS)) +
geom_point() +
gghighlight(SRS > 2, label_key = category)

I am trying to highlight specific teams. For example:

ggplot(Team_Records, aes(Year, SRS)) +
geom_point() +
gghighlight(Tm = "DET", label_key = category)

But if I run this code I receive an error, even though "Tm" is the correct variable and "DET" is the label. Any help or advice is greatly appreciated.

I am going to reply to my own embarrassing question since I did solve it after more tinkering
ggplot(Team_Records, aes(Year, SRS)) +
geom_point() +
gghighlight(Tm == "DET", label_key = category)

It's two = signs... it's that simple

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.