[R-sig-Geo] Help

Bede-Fazekas Ákos bf@levli@t @ending from gm@il@com
Mon May 14 13:42:10 CEST 2018


Dear Soufianou,
this is just a framework. Let's say that you have a vector ('variables') 
containing the name of the environmental variables.

library(raster)
library(dismo)
library(corrplot)

for (variable in variables) {
     assign(variable, raster(paste0(variable, ".asc"))
}
environment <- brick(variables)
environment_standardized <- data.frame(scale(x = 
as.data.frame(environment), center = TRUE, scale = TRUE))

correlation_matrix <- cor(environment_standardized, use = "na.or.complete")
corrplot(corr = correlation_matrix)
VIF <- vif(environment_standardized)
CN <- kappa(na.omit(environment_standardized), exact = TRUE)
# You can select variables that fulfill your criteria about correlation 
structure
selected_variables <- variables[c()] # subsetting

maxent(x = environment[[selected_variables]] , p = presence_points)

HTH,
Ákos Bede-Fazekas
Hungarian Academy of Sciences

2018.05.14. 12:28 keltezéssel, Soufianou Abou via R-sig-Geo írta:
> Dear Rolf Turner,
>
>   I have points of presence of cowpea in Niger in CSV format; in addition to other variables (soil texture, soil pH, altitude, I downloaded from worldclim archives, the 19 environmental variables, I cut them all at the Niger scale and I converted them under ASCUI format. The idea for me is to choose the best variables to include in the model.
>   NB. I'm using Maxent model, but I'm not good in R software.
>
> Merci
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> SADDA Abou-Soufianou
>
> --------------------------------------
>
> Doctorant
>
> Université Dan Dicko Dankoulodo deMaradi-Niger
>
> BP 465 120, avenue MamanKoraou- ADS
>
>                     &
>
> Institut d’Ecologie et des Sciencesde l’Environnement de Paris (iEES-Paris)
>
> Centre IRD France Nord-(iEES Paris)-32,av.Henri Varangnat 93143 BONDY cedex.
>
> |
> Lien: https://ieesparis.ufr918.upmc.fr/index.php?page=fiche&id=378&droit=1
>
>
>   abousoufianou at gmail.com
>
> GSM : Niger : (+227) 96-26-99-87/91-56-35-19 ; France (+ 33)  07-55-79-39-93
>
>   
>    |
>   
>    |
>
>
>
>
>
>
>
>
>
>
>      Le lundi 14 mai 2018 à 12:05:40 UTC+2, Rolf Turner <r.turner at auckland.ac.nz> a écrit :
>
>
>
> Please keep your posts "on-list".  You are much more likely to get a
> useful answer that way.  There are many others on the list whose
> knowledge and insight are far greater than mine.
>
> I have therefore cc-ed the list in this reply.
>
> On 14/05/18 21:48, Soufianou Abou wrote:
>
>> Thank you for advice, Rolf Turner
>>
>> My question is as follows:
>>
>> I'd use maxent to model the potential distribution of cowpea on the
>> basis of the only presence data. Indeed, I have acquired a number of
>> environmental variables and bioclimatic regarding my area of study. But
>> to choose the most contributive variables in the model; I would like to
>> make a correlation analysis of these. On this, could you explain to me
>> the step by step procedures to follow in R? I would like to say scripts
>> for:- compile and call all environmental variables;- run the correlation
>> test to select the least correlated ones.
> As I said before, I don't think this is the right approach, but I can't
> be sure without knowing more about your data.  I find your description
> to be vague.
>
> How are your data stored?  What information do you have about the
> "distribution of cowpea".  Do you have *points* where cowpea is present
> or more extensive *regions* where it is present?  (And could these
> regions be "considered to be points" on the scale of interest?) How are
> your predictors stored?  Are the values of these predictors known at
> every point of your study area?  Can you show us a bit of your data (use
> the function dput() to include *a small sample* of your data in the body
> of your email).
>
> If you insist on mucking about with correlation and testing, perhaps the
> function cor.test() will give you what you want.  I reiterate however
> that this seems to me to be a wrong approach.
>
> cheers,
>
> Rolf Turner
>



More information about the R-sig-Geo mailing list