[R] Frequencies from a matrix - spider from frequencies
Uwe Dippel
udippel at uniten.edu.my
Mon Mar 15 16:43:03 CET 2010
Jim Lemon wrote:
> Hi Uwe,
> Here's one way to get your spider plot:
>
> ld1<-matrix(sample(1:5,310,TRUE),nrow=31)
> ld2<-apply(ld1,2,table)
> radial.plot(ld2,line.col=2:6,rp.type="p",
> radial.pos=seq(0,9*pi/5,by=pi/5),
> labels=paste("Q",1:10,sep=""),start=pi/2,
> clockwise=TRUE,main="Frequency of response by question")
> par(xpd=TRUE)
> legend(8,12,1:5,col=2:6,lty=1)
> par(xpd=FALSE)
>
> Quite a bit of overlap on the polygons, however.
>
Thanks, Jim,
this one works (with your random data)! (In case anyone reads and wants
this as well, package plotrix provides radial.plot.)
The overlap is normal, because it's random data. When the respondents
have a less random streak of answering (and they do), this plot will
show some continuity throughout the questions; and identify those
questions clearly, which fall outside of this continuity.
This is why I prefer to use it here.
Uwe
More information about the R-help
mailing list