Symbols as text together with dots for each category and with the same

I would like to make a scatter plot in R, the Y and X variables over the Z categories (separated by colors), but with a custom legend. Not a legend box, but for category names that appear as text along the dots for that category, and the text must be the same color as the dots.

Is there a way for R to do this automatically?

PS: I know it can be done "manually" by adding "text ()" and specifying the location and color of each category

For example, I am trying to reproduce the appearance of this diagram (which I did manually in Stata):

enter image description here

EDIT: After reading the comments, below is the data and solution to the problem:

library(ggplot2);library(reshape);library(scales);library(directlabels)
dat <- read.csv("https://dl.dropboxusercontent.com/u/4329509/Fdat_graf.csv")
dat_long <- melt(dat, id="ano")
p <-   qplot(ano,value, data=dat_graf_long, colour=variable)+       scale_y_log10(breaks=c(.1,1,10,100,500,1000),labels = comma) + scale_x_continuous(breaks=seq(from=1960, to=2010, by=10))  + theme_bw()
direct.label(p)

      

For stakeholders, chart if for the sizes of commonly used datasets (household survey (PNAD, ~ 0.3 GB), CENSUS microdata (~ 10 GB) and register of all employment contracts (RAIS, 20 GB per year)), versus available server memory (RAM) with a decent size (base tier is 96GB server in 2010) growing by Moore Law. It shows how it was once thought that "big data" should become "small data" due to the advancement of Moore's Law.

+3


source to share





All Articles