Dear Liliana,
There is a mailing list on R-Forge associated with BIOMOD. You might
find good answers there to your questions.
>
> I have 3 questions.
> 1. In the tutorial for this package is described the function
> level.plot. It is useful to plot the results of every model but in
> the tutorial they ran the Models with "independent data", Is there
> any possibility to use this function without having to run the
> models with independent data?
Of course. The use of independant data in the manual is mostly to show
it can be done with independant data but in most cases we do not have
them.
>
> load("pred/Pred_Ag_cing")
> level.plot(Pred_Ag_cing[,"RF",1,1],coorxy,title='Ag_cingulata RF')
>
> Error in level.plot(Pred_Ag_cing[, "RF", 1, 1], coorxy, title =
> "Ag_cingulata RF") :
>
> data and coordinates should be of the same length
>
> length(coorxy$Longitude)
> [1] 2697182
>
> length(Pred_Ag_cing[,"RF",1,1])
> [1] 1350
>
> It gives me an error saying that the coordinates and the data must
> be the same length, (the truth is I don't get why without running
> the models with independent data it doesn't get the same length but
> with independent it does.)
The predictions are carried out on the data used to calibrate the
models not on the overall dataset. Because you are using
pseudoabsences, the models have been calibrated on the presences and
the selected pseudoabsences. Your 'coorxy' is probably containing the
overall dataset whereas the predictions have been carried out on
subsample.
2 solutions:
1) When running the models with pseudoabsences, BIOMOD creates a list
of vectors with the index of rows used for the models. The list is
called Biomod.PA.sample.
If you want to extract the rows used for species 1 and selection of
pseudo-absence 1, just type this:
Biomod.PA.sample[[1]][[1]]
Then, you just to have write this to plot the prediction (if we
considered Ag_cingulata as species 1 and you want to plot the
prediction from the first run of pseudoabsence.
level.plot(Pred_Ag_cing[,"RF",1,1], coorxy[Biomod.PA.sample[[1]]
[[1]],] , title='Ag_cingulata RF')
2) Maybe you want to see the overall prediction over the entire region:
You can use the Projection function to first used the calibrated
models to project over the whole dataset and then plot it.
You can also use grid (ASCII or ArcMap grid) directly in BIOMOD for
the projection. Just use the Projection.raster function. Then you can
simply plot the grids.
>
> 2. Is there any possibility to export the data to make
> the plots as an ascii files so can be imported into GIS?
If you just want to export points data for your species of interest:
MyData = cbind(coorxy[Biomod.PA.sample[[1]][[1]],] ,
Pred_Ag_cing[,"RF",1,1])
write.table(MyData, "MyData.txt")
> 3. Is the only form to plot the outputs of the models in GIS by
> extracting the model and using Raster Calculator? If it is the case,
> how do I get the final models of RandomForest, MARS and GAM?
In case you have large datasets, this is much better to work directly
with Raster in R.
There are now several packages in R (rdgal, raster).
Once your models are calibrated, just load your environmental
variables as raster format in R.
Let's say you have run your models with two variables:
library(raster)
Variable1 = raster("../../Variable1")
Variable2 = raster("../../Variable2")
Var = stack(Variable1, Variable2)
Then use the Projection.raster function in BIOMOD to project directly
on the stack (see ?Projection.raster). The results could then be
mapped very easily using plot.raster function from the raster package.
Hope it helps,
Wilfried
>
> Any help would be very much appreciated,
>
> Thanks a lot in advanced,
>
> Liliana Ballesteros
> PhD Student
> University of Basel
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
-------------------------
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: [email protected]
Home page: http://www.will.chez-alice.fr
Website: http://www-leca.ujf-grenoble.fr/equipes/tde.htm
FP6 European MACIS project: http://www.macis-project.net
FP6 European EcoChange project: http://www.ecochange-project.eu
[[alternative HTML version deleted]]
_______________________________________________
R-sig-ecology mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology