I have the following plot of a stock's price in response to time on different days. Currently, using geom_text I'm able to label the points of interest where the Y value deviates from 0 by a significant positive. However, I also wish to label the points where the Y is significantly less than 0. Currently, for geom_Text I have:
geom_text_repel(aes(label=ifelse(percent_change_price_SPY>0.35,as.character(DATE),'')))
I tried adding another condition to the if statement,
geom_text_repel(aes(label=ifelse((percent_change_price_SPY>0.35)|(percent_change_price_SPY<-.35),as.character(DATE),'')))
but it returned the error:
could not find function "|<-"
I also tried breaking it up into two geom_text calls
geom_text_repel(aes(label=ifelse(percent_change_price_SPY>0.35,as.character(DATE),''))) + geom_text_repel(aes(label=ifelse(percent_change_price_SPY<-0.35,as.character(DATE),'')))
but this command does not stop executing. any idea how to get both conditions to display?