I am trying to build a million data points in R. I am currently using ggplot2 (but I am open to suggesting alternative packages). The problem is that the chart takes too much time to render (often above a minute). I'm looking for ways to do this faster - ideally in real time. I will be grateful for any help - adding code to the question for clarity.
Creating a (random) data frame with ~ 500000 data points:
letters <- c("A", "B", "C", "D", "E", "F", "G") myLetters <- sample(x = letters, size = 100000, replace = T) direction <- c("x", "y", "z") factor1 <- sample(x = direction, size = 100000, replace = T) factor2 <- runif(100000, 0, 20) factor3 <- runif(100000, 0, 100) decile <- sample(x = 1:10, size = 100000, replace = T) new.plot.df <- data.frame(letters = myLetters, factor1 = factor1, factor2 = factor2, factor3 = factor3, decile = decile)
Now, let's build the data:
color.plot <- ggplot(new.plot.df, aes(x = factor3, y = factor2, color = factor1)) + geom_point(aes(alpha = factor2)) + facet_grid(decile ~ letters)

How to make rendering faster?
r plot ggplot2
Karan tibrewal
source share