[R] Bumps chart in R

Andreas Christoffersen achristoffersen at gmail.com
Mon Apr 27 16:13:02 CEST 2009


> Hi Andreas,
> Not too hard. Try this:

Amazing! - a bump.plot function - so cool. I love it when I
simultaneously realize the power of R and my own limitations with R. I
must learn how to write my own functions (suggestions for good
introduction are very welcome)

But: When I run the following
bump.plot(poor_1990,poor_2004,c("1990","2004"),countries,
linecol=1:20, pch=16, main="Bumps plot" ,rank=F)

1: It seams the data is somehow sorted/ordered perversely: Now Kina
(Danish for "China") e.g. has traded places with "Afrika syd for
sahara" (Danish for "Africa south of Sahara"), etc.

2: When I set e.g. right.labels=NULL - I get a lot of empty space. How
could I remove it?

p.s. For aesthetics I've change a tiny part of your function to
plot(c(rep(1,ny),rep(2,ny)),c(rev(y1),rev(y2)),xlim=c(0,3),xlab="",ylab="",
axes=T,xaxt="n",yaxt="s",bty="n",...)
Thereby adding an Y axis. - I don't really know whats going on - but I
could guess this was were the axis magic happened.

Cheers - a very gratefull andreas (especially if someone can help with
the misplaces labels mentioned in 1 above)




More information about the R-help mailing list