[Biomod-commits] Problem with projection by BIOMOD to raster files

Wilfried Thuiller wilfried.thuiller at ujf-grenoble.fr
Mon Feb 14 19:46:32 CET 2011


Dear all,

Several of you got this error.
It comes from the save function I am using to save the raster projections onto the hard drives.

The most common reason for failure is lack of write permission in the current directory. Make sure you do have the permission.

To decrease the size of the raster data on the hard drive, I am also using a compression option.

Have a look at ?save

I use the compress="xz" which the most time consuming but also the most efficient to compress large files. 

For those used to code in R, just open the Projection.raster in a new file, and replace "xz" by "gzip" (replace all in th function, there are several instances)  to see if it changes something. Then I try again. 

Best
Wilfried





Le 14 févr. 2011 à 17:34, <Horchler at bafg.de> a écrit :

> Dear list members,
> 
> I would like to project BIOMOD results (best model) to a raster file in order to import it into ArcGIS 9.3.
> I tried a rather simple example with two predictor variables and two species as response variables but got the following error message:
> 
>> Error in xzfile(file, "wb", compression = 9) : 
>  cannot open connection 
> 
> Here is what I types in R:
> _____________________________________________________________________
> 
> a<- read.csv2("E:\\data.csv", h=T, row.names=1)
> 
> library(BIOMOD)
> library(raster)
> library(rgdal)
> library(maptools)
> 
> 
> vmhq = raster("E:/vmhq")
> UFD = raster("E:/UFD")
> Var = stack(vmhq, UFD)
> 
> 
> Sp.Env <- a[c(1:2, 6:11)]
> attach(Sp.Env)
> 
> CoorXY <- a[1:2]
> attach(CoorXY)
> 
> Initial.State(Response=a[,9:10], Explanatory=a[,6:7],
> IndependentResponse=a[,9:10], IndependentExplanatory=a[,6:7])
> 
> Models(GLM = TRUE, TypeGLM = "quad", Test = "AIC", CTA = TRUE, CV.tree = 50, ANN = TRUE, CV.ann = 2,
>   NbRunEval = 2, DataSplit = 80, Roc=TRUE, Optimized.Threshold.Roc=TRUE, Kappa=TRUE, TSS=TRUE, VarImport=5,
>   NbRepPA=0, strategy="circles", coor=CoorXY, distance=2, nb.absences=1000)
> 
> Projection.raster(RasterProj = Var, Proj.name="Istzust", GLM=TRUE, BinKappa=TRUE, FiltKappa=TRUE)
> 
>> Fehler in xzfile(file, "wb", compression = 9) : 
>  kann Verbindung nicht öffnen
> 
> which means:
> Error in xzfile(file, "wb", compression = 9) : 
>  cannot open connection
> _______________________________________________________________________
> 
> 
> Could you please let me know what's wrong.
> Many thanks in advance!
> 
> Best rergards,
> Peter
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Dr. Peter J. Horchler
> (Dipl.-Biol.)
> 
> German Federal Institute of Hydrology
> Department Ecological Interactions
> 
> Am Mainzer Tor 1
> 56068 Koblenz
> Germany
> 
> Tel.	  +49-261-1306-5936
> Fax.	  +49-261-1306-5333
> E-mail  horchler at bafg.de
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> KLIWAS        www.kliwas.de
> INFORM        www.bafg.de/INFORM
> NOFDP         www.nofdp.net 
> _______________________________________________
> 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/20110214/0f324486/attachment.html>


More information about the Biomod-commits mailing list