Customizing points in R

2019-08-28 05:27发布

问题:

I am wondering if R has the capability to help me shade specific quadrants of scatterplot points. Specifically I am thinking of using shape 10 (here: http://sape.inf.usi.ch/quick-reference/ggplot2/shape) and want to fill each quadrant given a certain condition.

My current (relevant) code is:

q1 <- ggplot(data12, aes(x=pbpm_did, y=acutecare_stays)) + 
geom_point(shape = (ifelse(data12$acutestays_statsig>0, 10, 16)), color=Teal, size=7))

Ideally I would be able to fill quadrants of the geom_point under specific ifelse conditions.

I've seen posts on layering the points but I don't think that will work because I don't want the entire shape filled unless all my conditions have been met. Any thoughts are greatly appreciated.

标签: r ggplot2