Skip to content

Heat Map for species - code from Numerical Ecology with R

4 messages · Valerie Mucciarelli, Sarah Goslee

#
Hi Valerie,

Are you using your own data or data provided by the authors?

If the latter, where can we get it?

If the former, please provide a reproducible example using dput() to
include some of your data.

Also, please resend your message with HTML mail turned off so we can
actually read it.

Providing a reproducible example makes it possible for us to figure
out what went wrong.

Sarah

On Tue, Jul 23, 2013 at 2:49 PM, Valerie Mucciarelli
<soccermucc at hotmail.com> wrote:

  
    
#
Thank you Sarah for pointing out to me to turn HTML off. ?Here is the message again. ?To answer your questions the data I provide below is MY data.

? 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?
#
Hi Valerie,

On Tue, Jul 23, 2013 at 4:06 PM, Valerie Mucciarelli
<soccermucc at hotmail.com> wrote:
That's still not a reproducible example, but much more readable.

Your guess appears to be correct: the help for vegemite specifically says:

 The table is printed in compact form: only one character
     can be used for abundance, and there are no spaces between
     columns.

and later suggests cut() or approx() for making cover scales.
Depending on your data, the scale argument to vegemite might be of
use.

There's a r-sig-ecology email list that you might be interested in joining.

Sarah