[R] Kite diagrams
par at hunter-gatherer.org
Mon Jan 16 11:41:29 CET 2006
Barry Rowlingson <B.Rowlingson at lancaster.ac.uk> [2006.01.16] wrote:
> The joy of R is that of course there is a way to create these - you
> just have to write the code!
Ok. time to start learning...
> The data are, I guess, on the X-axis a discrete set of distance
> points, (identical for each species?), and then for each species an
> abundance measurement - is this continuous or discretized, or does it
> only take the values shown on the key ('ACFOR' = Abundant, Common,
> Frequent, Occasional, Rare??). Looking at the kites I'd guess the data
> are numbers and nearly-continuous.
In our case I would expect them to mostly be numbers, as continous as
real world things actually get, but sometimes only ACFOR. That is, I need
to code it to handle both cases.
> Anyway, you can use plot() with type='n' to set out a blank plot with
> X-axis according to your distance scale and a Y-axis of something like
> 1:Nspecies, then use the polygon() function to draw the little kites,
> making sure you dont draw anything between separated kites. This
> probably means several polygon() calls or sticking NA's in the coordinates.
> Adding the little cross-section of the shoreline at the top is
> possible too...
> >Previously when the course was taugh the students have either abused MS
> >Exel or drawn the diagrams by hand.
> Whereas now they can just rely on the goodwill of R-help to do it! :)
I *was* hoping for "use the kite package from CRAN, silly", but
pointers on how to code such a package myself is ok. Good practice, and
a way to repay R for all the use I've gotten from it.
Knowing students I not only need to make it work, but also write
drool-proof instructions for how to use it. :-)
> Why do these interesting questions always seem to occur on a Monday
> morning when I really dont want to get on with the stuff I'm supposed to
> be doing....
Because the universe loves you and hates your employer. Or vice versa.
Par Leijonhufvud par at hunter-gatherer.org
`You know, there's a word for people who
think that everyone is out to get them...'
`Yes! Perceptive!' --Woody Allen
More information about the R-help