[R] Preparing data frame for Plotrix kiteChart

Jim Lemon jim at bitwrit.com.au
Sat Sep 18 23:38:47 CEST 2010


On 09/18/2010 03:32 AM, Graham Smith wrote:
> ...
> What I am hoping for is:
>
> an x-axis labelled "Distance" with tick marks at 0, 5, 10,15,20 and 25.
>
> And, an y-axis labelled "Species" and tick marks labelled A, B and C.
>
>
> So I would appreciate some help on how the data should be prepared for
> kiteChart, to maximise the lablels being added automatically. If possible.
>
Hi Graham,
Ben's solution is excellent, I just thought I would add an alternative 
starting with the X dataframe:

x2<-matrix(X$Count,ncol=3)
rownames(x2)<-unique(X$Distance)
colnames(x2)<-unique(X$Species)
kiteChart(t(X3),xlab="Distance",ylab="Species")

There are a number of other options like color and scaling available.

Jim



More information about the R-help mailing list