[R-sig-eco] Heat Map for species - code from Numerical Ecology with R

Jari Oksanen jari.oksanen at oulu.fi
Wed Jul 24 14:37:13 CEST 2013


Vegemite is vegemite because it is so condensed. It is condensed because it uses only one column for data and no separators between columns. If you want to print your full data, just do so. You do not need any fancy functions for the purpose. If you want to reorder your data, learn how to use row and column indices. For vegemite you need one-character scaling, and vegemite provides some popular alternatives. You are not limited those, nor to numeric characters, but you can roll your own.

If you do not provide one-character data, vegemite gives an error message that is intended to be informative: it says what was the problem, and suggests what to do (use scale). See ?vegemite.

Vegan provides an interface to standard graphical heatmap. This sister of vegemite is called tabasco (because it is also condensed but hotter than vegemite). It takes any non-negative data, but you may need scaling to see shades of colours. Names can also be unreadable in large tables. Fixes are welcome. I think ade4 may have something similar.

Cheers, Jari Oksanen
---- alkuperäinen viesti ----
Lähettäjä: Basil Iannone
Lähetetty:  24.07.2013, 14:57
Vastaanottaja: Sarah Goslee
Kopio: r-sig-ecology at r-project.org
Aihe: Re: [R-sig-eco] Heat Map for species - code from Numerical Ecology with R

Valarie,

I too ran across this problem. vegmite operates on data with a single digit
such as Braun-Blanquet cover estimates. Thus vegemite command will not work
on data such as environmental data or biomass data unless you convert it to
a single digit, causing you to loose a lot of information. So in short,
vegmite is a method used to compile and arrange single digit cover
estimates into a table. If you find a similar function that works on other
kinds of data, please let me and the other R users know.

And someone please correct me if my assessment of the situation is
incorrect.


On Wed, Jul 24, 2013 at 6:14 AM, Sarah Goslee <sarah.goslee at gmail.com>wrote:

> Hi Valerie,
>
> Did the suggestions given on the R-help list fail to work?
>
> You do need to provide you abundance data as one character, as specified in
> ?vegemite which also gives suggestions for conversion.
>
> Sarah
>
> On Tuesday, July 23, 2013, Valerie Mucciarelli wrote:
>
> > Hello,
> >
> > I am relatively new to R and I am working through the code that is
> > provided in the book Numerical Ecology with R:
> > http://xa.yimg.com/kq/groups/19243105/1919134110/name/Numerical.pdf (pg
> > 79)
> >
> >  and I have run across an error message that I can't seem to figure out.
> >
> >  I am using the vegan, ade4, gclus and cluster packages. The code is as
> > follows:
> >
> >  # Ordered community table
> >  # Species are ordered by their weighted averages on site scores
> >
> >  or <- vegemite(spe, spe.chwo)
> >
> >  spe is the dataframe, here is part of it:
> >
> >      AGA   ANT  BON   CAL1   CAL   CER   CRY   DES  EUTH FRY
> >  1  0.420 0.092 0.051 0.000 0.975 0.000 0.111 0.000 0.127 0
> >  2  0.000 0.000 0.007 0.002 0.915 0.000 0.000 0.000 0.151 0
> >  4  0.000 0.008 0.000 0.009 0.124 0.003 0.000 0.000 0.095 0
> >  7  0.000 0.002 0.003 0.002 0.121 0.002 0.000 3.573 0.180 0
> >  12 0.000 0.020 0.000 0.002 0.444 0.001 0.000 0.000 0.242 0
> >  13 8.727 0.000 0.000 0.000 0.743 0.000 0.000 0.000 0.050 0
> >  14 2.163 0.009 0.000 0.003 1.121 0.000 0.000 0.000 0.051 0
> >  15 0.000 0.004 0.000 0.000 0.109 0.000 0.000 0.000 0.007 0
> >  18 9.021 0.018 0.002 0.000 0.286 0.000 0.000 0.000 0.028 0
> >  19 0.000 0.038 0.000 0.019 0.509 0.000 0.000 0.000 0.155 0
> >
> >  spe.chwo came from:
> >
> >  spe.norm <- decostand(spe, "normalize")
> >  spe.ch <- vegdist(spe.norm, "euc")
> >  spe.ch.UPGMA <- hclust(spe.ch, method = "average")
> >  spe.chwo <- reorder.hclust(spe.ch.UPGMA, spe.ch)
> >
> >
> >  and the error is:
> >
> >  Error in vegemite(spe, spe.chwo) :
> >  Cowardly refusing to use longer than 1 char symbols:
> >  Use scale
> >
> >  The data in the dataframe is biomass data recorded to 4 digits. I'm
> > wondering if this code is not working because my data is more than one
> > digit long.
> >
> >  Any suggestions or insight on how to get this code to work would be
> > greatly appreciated.
> >
> >  Thank you,
> >
> >  Val
> >
> >
>
> --
> Sarah Goslee
> http://www.stringpage.com
> http://www.sarahgoslee.com
> http://www.functionaldiversity.org
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>


--
Basil V. Iannone III, Ph.D.
University of Illinois at Chicago
Department of Biological Sciences (MC 066)
845 W. Taylor St.
Chicago, IL  60607-7060
Email: bianno2 at uic.edu
Phone: 312-355-0987
Fax: 312-413-2435
http://www2.uic.edu/~bianno2

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list