On Mon, 14 Jun 2010, Kenneth Takagi wrote:

Rosi,
I forgot to add that you need to install package "GEOquery" first to access gunzip function.

And a little but important detail - this is not a CRAN package but a BioConductor one:

http://bioconductor.org/packages/2.6/bioc/html/GEOquery.html

so will further require Biobase and RCurl. The GEO here means "Gene Expression Omnibus", rather than what one might expect.

Depending on your platform, you may also be able to use system() to call a freestanding archive program of your choice to decompress the *.gz file. This may be as easy as installing BioConductor packages, if you haven't done that before.

Roger


-Ken

On 6/14/2010 12:30 PM, Kenneth Takagi wrote:
Rosi,

Try this:
#unzip "temp.gz" files and save file as "temp.txt":
gunzip(filename = "temp.gz", remove = T, overwrite = T, destname =
"temp.txt")
#now read in "temp.txt" as SpatialGridDataFrame
SGDF = read.asciigrid("temp1.txt", proj4string = CRS("+init=epsg:4322"))

This assumes that "temp.txt" is a ascii grid file.
HTH,
Ken
On 6/14/2010 11:27 AM, Roger Bivand wrote:
On Mon, 14 Jun 2010, Siber Rosi wrote:

Dear all, Is it possible to import Esri ascii files which are
compressed in a .gz file direct to R? My example : 111212.asc in an
.gz File I thought there might be a similar command as the
"zip.file.extract"- command. I tried the "gzfile" command, but it did
not work. Do you have any suggestions?

The readGDAL command in rgdal needs a file, I believe, as also does
readAsciiGrid() in maptools. The header is part of the same file, so it
needs to be read in different ways, first to get the metadata, then to
read the data.

Roger

Thank you very much in advance.
Best wishes, Rosi


???
Rosi Siber
Swiss Federal Institute of Aquatic Science and Technology (Eawag)
Siam
Ueberlandstrasse 133
8600 Duebendorf
Switzerland
Phone: +41 (0)44 823 5566
Fax: +41 (0)44 823 5375
rosi.si...@eawag.ch
http://www.eawag.ch/~siberros






[[alternative HTML version deleted]]




_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: roger.biv...@nhh.no

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to