[R] line vector plots

Jim Lemon bitwrit at ozemail.com.au
Tue Nov 1 22:20:22 CET 2005


Eduardo Klein wrote:

 > Hi Jim,
 >
 > Thanks for the tip, but I really need the same polar chart but over a 
line no in a circle. I didn't find it on the plotrix package.
 >
Hmmm, are you looking for something like this?

feather.plot<-function(x,y,xpos,yref=0,use.arrows=FALSE,...) {
  if(missing(xpos)) xpos<-1:length(x)
  xlim<-range(x+xpos)
  ylim<-range(y)
  plot(0,xlim=xlim,ylim=ylim,type="n")
  abline(h=yref)
  if(use.arrows) arrows(xpos,yref,xpos+x,y,length=0.1,...)
  else segments(xpos,yref,xpos+x,y,...)
}

where x and y are the components of the vectors and xpos is the 
positions on the time line? If so, I'll add that to plotrix - looks useful.

Jim




More information about the R-help mailing list