[R-sig-Geo] Help with ENFA in R

Mathieu Basille basille at ase-research.org
Wed Apr 10 00:01:48 CEST 2013

Le 04/09/2013 03:51 PM, JonathanAronson a écrit :
> Hi Mathieu
> Thank you so much for your quick response. I really appreciate the effort
> and thank you for your answers.
> I am now using the AdehabitatHS package but still have some questions.
> 1) I am not sure what (renfa$expvar), (renfa$pvalue) and (renfa$obs) are
> actually telling me in the output. I have copied the output below:
> (renfa$expvar)
>      Std.Obs Expectation    Variance
>    45.557688    7.316997   11.538948

$expvar gives you the expected value from the simulated set 
('Expectation'), i.e. the mean of the simulated values, together with its 
variance. 'Std.Obs' tells you how much the observed value differs from the 
distribution: it is basically the ratio of the difference between the 
observed and the mean of simulated values, over the standard deviation of 
the simulated values. You expect a difference equal to the SD, i.e. a ratio 
'Std.Obs' of 1.

>> (renfa$pvalue)
> [1] 0.001

This is the p-value of the test. See ?randtest for the details of the 

>> (renfa$obs)
> [1] 162.072

This is the observed value (here the first specialization eigenvalue).

The best way to summarize the results is to simply print the object, by a 
direct call to 'renfa' in your case. Then, use 'plot(renfa)' for a very 
neat graphical display of the test.

> 2) because i am using AdehabitatHS do I not need the following line of code
> anymore:
> map<- as.kasc(list(bio_01 = var1, bio_12 = var2, Aridity = var3, altitude =
> var4, unpalatable = var5, thicket = var6, succulent = var7, shrubland =
> var8, rainforest = var9, mosaic = var10, mopane = var11, misavanna = var12,
> hydro = var13, fynbos = var14, desert = var15))
> enfatest<- data2enfa(map, test)

No you don't. adehabitatHS uses 'sp' classes. Please have a look at the 
vignette of both packages for more details:


> 3) I also got two error messages:
>> image(enfatest1)
> Error in image.default(enfatest1) : 'z' must be a matrix

This is quite normal... Assuming 'enfatest1' is the result of the ENFA, 
there's no image function for such object... Check the section on the ENFA 
in the above cited vignette.

>> niche.test(map, test, nrepet = 999, o.include = FALSE)
> Warning messages:
> 1: In hist.default(x, plot = FALSE, br = xbr, freq = FALSE) :
>    argument ‘freq’ is not made use of
> 2: In hist.default(y, plot = FALSE, br = ybr, freq = FALSE) :
>    argument ‘freq’ is not made use of

Not sure here, but I bet that the problem comes also from the class of 
'map' and/or 'test'. Check the vignette and the example of the function.


> Mathieu, could you please provide some assistance with these questions?
> Thank you
> Jonathan
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Help-with-ENFA-in-R-tp7583243p7583258.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


~$ whoami
Mathieu Basille, PhD

~$ locate --details
University of Florida \\
Fort Lauderdale Research and Education Center
(+1) 954-577-6314

~$ fortune
« Le tout est de tout dire, et je manque de mots
Et je manque de temps, et je manque d'audace. »
  -- Paul Éluard

More information about the R-sig-Geo mailing list