I am trying to add a condition to geom_point size and I\'ve pasted my example below. I would like geom_point size to be 2 when n_in_stat is 4 or more, and size = 5 when n_i
scale_size_manual sets the sizes for a discrete variable.
geom_point(aes(size =n_in_stat>4)) + scale_size_manual(values=c(2,5))
also you can just use a function:
ff <- function(x){ifelse(x < 4, 5, 2)}
and then change
geom_point(aes(size = n_in_stat)) +
with
geom_point(aes(size = ff(n_in_stat))) +