I am using ggplot2 to visualize three variables from a dataset such as this:
data = data.frame(x = sample(1:10, 10, replace=TRUE), y = sample(1:10, 10, replace=TRUE), Rank = sample(1:10, 10, replace = TRUE))
with example code here:
ggplot(data, aes(x = x, y = y)) + geom_point(aes(size = Rank))
However, I would like the size of a point to be inversely proportional to its rank, so that points with a rank close to ‘1’ are large, and for this to be displayed correctly in the legend.
Can anyone help?
You could use
1/Rank: