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

Mathieu Basille basille at ase-research.org
Tue Apr 9 19:23:14 CEST 2013


Dear Jonathan,

Here are a few comments:

1) I strongly suggest that you update to 'adehabitatHS', which has 
superseded the good-old 'adehabitat'. See [1]. It will solve your error 
with 'niche.test'.

2) For the tolerance, 'niche.test' will give you both the marginality and 
the tolerance.

3) For the randomization test of the ENFA, please have a look at 
?randtest.enfa, and at ?randtest for more details about the object returned.

4) You don't need to call 'list(...)' to get the values. For example, 
'enfatest1$m' would give you the answer.

5) I would also advise you to check this reference [2] about comparison 
between species niche. The function 'niche' in ade4 is probably what you're 
looking for...

Hope this helps,
Mathieu.


[1] http://cran.r-project.org/web/packages/adehabitatHS/index.html

[2] Doledec, S.; Chessel, D. & Gimaret Carpentier, C. (2000) Niche 
separation in community analysis: A new method. Ecology, 81: 2914-2927 doi 
10.1890/0012-9658(2000)081[2914:NSICAA]2.0.CO;2


Le 04/09/2013 08:49 AM, JonathanAronson a écrit :
> Hello there
> I am really hoping someone out there can help me. I have read the various
> forums but havent found information that can help me.
> I am running an ENFA in R for 12 species using 15 environmental variables.
> Below is my code and some questions:
>
>
> library(ade4)
> library(adehabitat)
> test<- read.csv("Species_Localities/R.blasii.csv", header=T)
> var1<- import.asc("Data/bio_01.asc")
> var2<- import.asc("Data/bio_12.asc")
> var3<- import.asc("Data/Aridity.asc")
> var4<- import.asc("Data/altitude.asc")
> var5<- import.asc("Data/unpalatable.asc")
> var6<- import.asc("Data/thicket.asc")
> var7<- import.asc("Data/succulent.asc")
> var8<- import.asc("Data/shrubland.asc")
> var9<- import.asc("Data/rainforest.asc")
> var10<- import.asc("Data/mosaic.asc")
> var11<- import.asc("Data/mopane.asc")
> var12<- import.asc("Data/misavanna.asc")
> var13<- import.asc("Data/hydro.asc")
> var14<- import.asc("Data/fynbos.asc")
> var15<- import.asc("Data/desert.asc")
> 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)
> pc <- dudi.pca(enfatest$tab, scannf = FALSE, nf = 1)
> enfatest1 <- enfa(pc, enfatest$pr, scannf = FALSE)
> renfa <- randtest(enfatest1, nrepet=999)
> list(enfatest1$m)
> list(enfatest1$s)
> list(enfatest1$co)
> hist(enfatest1)
> hist(enfatest1, scores = FALSE, type = "l")
> image(enfatest1)
> list(renfa$expvar)
> list(renfa$pvalue)
> list(renfa$obs)
> scatter(enfatest1)
> niche.test(map, test, nrep = 999, o.include = TRUE)
>
> list(enfatest1$m) has given me the global marginality for each species and
> those are:
>
> Species            Marginality
> R.a 	                  4.8
> R.b 	                 12.47
> R.ca 	                 19.27
> R.cl 	                 15.16
> R.da 	                 12.36
> R.de 	                 15.31
> R.e 	                 12.19
> R.f 	                  6.07
> R.h 	                  9.65
> R.l 	                  9.14
> R.si 	                 13.7
> R.sw 	                 13.11
>
> I do not know how to get the global tolerance scores. Can you please help me
> with that?
>
> I also do not know what the randomisation test for ENFA does. Could you
> please explain that?
>
> I am unsure about what list(renfa$expvar), list(renfa$pvalue),
> list(renfa$obs) are telling me. I get a p-value of 0.001.
>
> I have tried to test the significance of my results using a Monte Carlo test
> but i get this error when I run the code:
>
> Error in niche.test(map, test, nrepet = 999, o.include = TRUE) :
>    should be an object of class SpatialPixelsDataFrame
>
>
> Please can someone provide some assistance because I have been stuck with
> this for months.
> Thank you in advance
> Jonathan
>
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Help-with-ENFA-in-R-tp7583243.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
http://ase-research.org/basille

~$ 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