[Biomod-commits] Uncorrect mapping coordinates : coor and Data are not of the same length

Wilfried Thuiller wilfried.thuiller at ujf-grenoble.fr
Wed Dec 7 17:10:23 CET 2011


Dear Amandine,

This is difficult to answer with the former calls (Initial.States and Models).

Using the BIOMOD data, it works quite well:

data(Sp.Env)
data(CoorXY)
#use fix(Sp.Env) to visualise the dataset

#This command is necessary for the run of BIOMOD as a new dataframe is produced for the Models function
Initial.State(Response=Sp.Env[,12:13], Explanatory=Sp.Env[,4:10], 
IndependentResponse=NULL, IndependentExplanatory=NULL)


Models(GLM = F, TypeGLM = "quad", Test = "AIC", GBM = FALSE, No.trees = 3000, GAM = FALSE, CTA = TRUE, CV.tree = 50, 
   ANN = FALSE, CV.ann = 2, SRE = FALSE, quant=0.05, FDA = TRUE, MARS = TRUE, RF = TRUE, NbRunEval = 2, DataSplit = 80,
   Yweights=NULL, Roc=TRUE, Optimized.Threshold.Roc=TRUE, Kappa=F, TSS=TRUE, KeepPredIndependent = FALSE, VarImport=5,
   NbRepPA=2, strategy="random", coor=CoorXY, distance=2, nb.absences=500)
   
   
multiple.plot(Pred_Sp290[, 1:9, 1, 1], CoorXY[Biomod.PA.sample$Sp290$PA1,])   

Cheers,
Wilfried





Le 7 déc. 2011 à 17:45, Amandine Cornille a écrit :

> 
>         
> Hi all, 
> 
> I am using Biomod package for niche modelling. 
> 
> I did the initial state and lauched the model. After I tried to plot the predictions on a map, but I have this error message : 
> 
> 
> > multiple.plot(Pred_sylvestris[,1:9,1,1],coordXY[Biomod.PA.sample$MyDataPA2$PA1,])
> Erreur dans multiple.plot(Pred_sylvestris[, 1:9, 1, 1], coordXY[Biomod.PA.sample$MyDataPA2$PA1,  : 
>   Uncorrect mapping coordinates : coor and Data are not of the same length
> 
> When I checked  files I used, indeed coor and data are not one the same length... 
> 
> > length(coordXY)
> [1] 2
> > length(Biomod.PA.sample)
> [1] 1
> 
> > head(coordXY)
>       X     Y
> 1 16.12 47.88
> 2 16.11 47.89
> 6 16.22 48.39
> 7 17.19 44.00
> 8  4.33 50.94
> 9 15.57 44.97
> > head(Biomod.PA.sample)
> $sylvestris
> $sylvestris$PA1
>    [1]     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16
>   [17]    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32
>   [33]    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48
>   [49]    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64
>   [65]    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80
>   [81]    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96
> 
> I deleted all duplicate XY coor in the case of it was that by using : MyData3<-MyData[!duplicated(MyData[,c(1,2)]),]
> 
> But After re ran initial.state and models, It didn't work again giving the same error message ....
> 
> May you help me please ? 
> 
> Thanks a lot for your help, 
> 
> Amandine 
> 
>       
> _______________________________________________
> Biomod-commits mailing list
> Biomod-commits at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/biomod-commits

--------------------------
Dr. Wilfried Thuiller
Laboratoire d'Ecologie Alpine, UMR CNRS 5553
Université Joseph Fourier
BP53, 38041 Grenoble cedex 9, France
tel: +33 (0)4 76 51 44 97
fax: +33 (0)4 76 51 42 79

Email: wilfried.thuiller at ujf-grenoble.fr
Personal website: http://www.will.chez-alice.fr
Team website: http://www-leca.ujf-grenoble.fr/equipes/emabio.htm

FP6 European MACIS project: http://www.macis-project.net
FP6 European EcoChange project: http://www.ecochange-project.eu






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/biomod-commits/attachments/20111207/62abe748/attachment-0001.htm>


More information about the Biomod-commits mailing list