[R-sig-eco] Making this plot in R: relative abundance vs. environmental gradient with each species ranked by niche optimum

Gavin Simpson gavin.simpson at ucl.ac.uk
Tue Sep 14 10:21:30 CEST 2010


On Sat, 2010-09-11 at 19:24 -0700, Laura S wrote:
> Dear all:
> 
> I am interested in plotting species relative abundance versus niche position
> along an environmental gradient. I would like the species' position along
> the the x-axis (environment gradient position) to be ranked according to
> each species' niche optima. I have seen this type of plot in publications,
> but I am not sure how to make a nice plot in R.
> 
> Any thoughts are greatly appreciated.
> 
> Thank you for your time and consideration,
> Laura
> 

Hi Laura,

Can you provide an example (i.e. show us one of these figures)? I work
at a UK University so if you have a citation to hand I should be able to
get it to look at the sort of figure you have in mind.

Your description is too ambiguous as it is for me to grep what you want.

For example, if x-axis is in a continous variable (the environment) then
and you have an abundance for each of m species at n locations on the
gradient, then matplot and matlines (if your data are sorted in x) will
do this plotting for you.

## For example, from Example section of ?decorana:

require(vegan)
data(varespec)
### the detrending rationale:
gaussresp <- function(x,u) exp(-(x-u)^2/2)
x <- seq(0,6,length=15) ## The gradient
u <- seq(-2,8,len=23)   ## The optima
pack <- outer(x,u,gaussresp)

matplot(x, pack, type="l", main="Species packing")

Is that what you want?

G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-sig-ecology mailing list