In a plot of Y and X over categories Z, I would like for categories to be represented by points of different collor, except for one category, which I would like to be displayed as a line connecting the points.
Here is the data and what I have so far:
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)
I would like for the "Lei_de_Moore" category to be represented by a line, as in this example (done in Stata):
Also, I would like to change a few things (maybe I should ask tem in different topic?):
- Change the style of the graph colors more "vivid", as in the Stata example
- Change the Y aixis. I just want plain Numbers in non-scientific notation form. I used the labels="comma", but I don't want the coma itself. Ideally I would like the comma to be the decimal place separator.
EDIT: I had asked another question on how to embed the legend for this graph (this post: Legend as text alongside points for each category and with same collor)