[R] Frequencies from a matrix - spider from frequencies
Jim Lemon
jim at bitwrit.com.au
Mon Mar 15 12:38:04 CET 2010
On 03/15/2010 06:24 PM, Uwe Dippel wrote:
> ...
> And, now somewhat less of the ordinary, a spider/radar showing the
> number of responses for each question (circular axis, 10), with the
> frequencies as radial axes. That is, 5 polygons showing the frequencies
> of the responses per each question.
>
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.
Jim
More information about the R-help
mailing list