circular-waffle-chart with data.table

Continuing the discussion from Circular waffle chart (plum chart) in R:

library(ggplot2)
library(ddata.table)
DF <- data.table(expand.grid(-30:30, -30:30))
DF<-DF[,R :=sqrt(Var1^2 + Var2^2)][R <= 30][,
  COVID := sample(c("Recovered", "Dead"), .N, replace = TRUE, 
                  prob = c(0.9, 0.1)),]
DF[,ggplot(.SD, aes(x = Var1, y = Var2, color = COVID)) +
     geom_point(size = 0.9) + coord_fixed(),]

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