I'm wondering if the ggpairs() function can be set up to be as fast and flexible as pairs() (flexible in terms of coloring, I realize that a user can do a lot more with ggpairs but i'm more familiar with base r pairs()).
Here is a pairs example using the diamonds data set:
diamonds$zcolor <- character(nrow(diamonds))
above <- 0.7
below <- 0.6
diamonds$zcolor[diamonds[['carat']] < below] <- "#E74C3C"
diamonds$zcolor[diamonds[['carat']] <= above & diamonds[['carat']] >= below] <- "#F1C40F"
diamonds$zcolor[diamonds[['carat']] > above] <- "#2ECC71"
pairs(head(diamonds[,1:10], 1800), col = diamonds$zcolor)
Essentially, coloring the data depending on the value of carat. In the app i'm working on the user can set the thresholds(above
& below
) for different colors. I want to have the same functionality with ggpairs - to choose the color thresholds based on a slider. Even still, without coloring ggpairs seems to render much slower than regular pairs. Is there a way to remedy this?