Hello all,
I'm making a chart with the following code:
# ------------
# begin
# ------------
library(ggplot2)
library(grid)
mydf <- read.csv(file='
http://dpaste.com/24KGSW9.txt', sep=',')
head(mydf)
g <- ggplot(data=mydf, aes( x=t.ano, y=nn.t.grupo, size=t.ttgrupo)) +
geom_point(shape=21) +
scale_size_area(max_size=12) +
scale_x_continuous(limits=c(min(mydf[,'t.ano']), max(mydf[,'t.ano'])), breaks = seq(min(mydf[,'t.ano']), max(mydf[,'t.ano']),by=1)) +
scale_y_continuous(limits=c(min(mydf[,'nn.t.grupo']), max(mydf[,'nn.t.grupo'])), breaks = seq(min(mydf[,'nn.t.grupo']), max(mydf[,'nn.t.grupo']),by=1)) +
geom_segment( data=mydf, aes( x = xbeg, y = ybeg, xend = xend, yend = yend),
arrow = arrow(length = unit(0.30,"cm"), type='closed'), size=0.5, color='black') +
theme(legend.position='none')
print(g)
# ------------
# end
# ------------
The link to the graph is here.
http://i.imgur.com/o0nyYzA.pngI need to start and stop the arrows on the edges of the circles, given the size of the circles depends on the variable mydf$t.ttgrupo. I would have to know the radius of the circles to discounts them in variables mydf$xbeg and mydf$xend. Any tips on how to do this?
Best
Roney