Hello list,

I have a felling this is a generic error but nonetheless, it has been
bugging me extensively. If anyone can chip in, I would most appreciate.

I'm trying to calculate expected species richness, following Kindt&Coe Tree
diversity analysis from my dataset but I get the following error:

> divjack <- diversityresult(PoCom, index="Jack.1")
Error in round(result, digits = digits) :
  Non-numeric argument to mathematical function

PoCom is a community data.frame with rows as locations and columns as
species (as in test dataset called "dune" in the book mentioned earlier).
Here is a head(PoCom) and first few lines of str(PoCom):

> head(PoCom)
    Sal_idae Pil_mili Syl_idae Ner_sp. Ner_rava Sab_spin Neo_pseu
HM1       12       14        5      13        1        1       28
HM2      123        5      113      28       44       17        0
HM3       13       55        8      40        0        2        7
HM4      141       23       56      91       74        6        0
HM5        7        0       20      18       11      114        0
HM6       13       14        0       7        0       39        8

> str(PoCom)
'data.frame':   10 obs. of  83 variables:
 $ Sal_idae : int  12 123 13 141 7 13 289 318 99 124
 $ Pil_mili : int  14 5 55 23 0 14 15 23 86 138
 $ Syl_idae : int  5 113 8 56 20 0 45 122 0 2
 $ Ner_sp.  : int  13 28 40 91 18 7 42 41 24 0
 $ Ner_rava : int  1 44 0 74 11 0 16 34 0 35
 $ Sab_spin : int  1 17 2 6 114 39 0 8 2 0
 $ Neo_pseu : int  28 0 7 0 0 8 3 0 12 99

Debugging stops here:

Browse[1]> n
debug: if (method != "jackknife") {
    result2 <- round(result, digits = digits)
    result2 <- data.frame(result2)
    colnames(result2) <- index
}
Browse[1]> n
debug: result2 <- round(result, digits = digits)
Browse[1]> n
Error in round(result, digits = digits) :
  Non-numeric argument to mathematical function

	[[alternative HTML version deleted]]

