Re: [R-sig-Geo] Reading an Ascii file

2009-01-14 Thread Kamran Safi
Hi all, This should deliver the results Julie is looking for: library(rgdal) library(maptools) grid <- readAsciiGrid("") table <- data.frame(grid) That was it! Replace s1 and s2 with X and Y. Kamran Kamran Safi Postdoctoral Research Fellow Institute of Zoology Zoolo

Re: [R-sig-Geo] Reading an Ascii file

2009-01-14 Thread Robert Hijmans
Dear Julie, This is one way to do that, using the raster package (under development): install.packages("raster", repos="http://R-Forge.R-project.org ") require(raster) r <- rasterFromFile("d:/alt.asc", TRUE) xy <- xyFromCell(r, 1:ncells(r)) xyv <- cbind(xy, values

Re: [R-sig-Geo] Reading an Ascii file

2009-01-14 Thread milton ruser
Hi Juliane, re-reading your email, you told that want a table with x, y and values. How about you explain a little bit about what you means at the end of your analyzis? It will help our community help you. best wishes, miltinho brazil On Wed, Jan 14, 2009 at 9:18 PM, milton ruser wrote: > Dear

Re: [R-sig-Geo] Reading an Ascii file

2009-01-14 Thread milton ruser
Dear Juliane, It depents what you want with the data. You can, for example, use import.asc function (adehabitat package; rename your file from .txt to .asc), or try rgdal package. Of course, you can also use read.table("myfile.txt", header=F, skip = 6) and deal your data as matrix. good luck,

Re: [R-sig-Geo] autologistic model in R

2009-01-14 Thread Paulo Justiniano Ribeiro Jr
Nicola Rcitrus and stLattice are "unofficial" packages mantained by Elias Krainski and available from links at www.leg.ufpr.br. Rcitrus implements a simple autologistic model motivated by the need to analyse date from citrus fields using such model. It also implements some other methods commonly

[R-sig-Geo] Reading an Ascii file

2009-01-14 Thread Juliane Struve
Dear list, I am trying to read ArcGIS raster data sets into R after converting them into ASCII .txt file. The text file I am trying to read contains ncols 250 nrows 276 xllcorner 344147.1949 yllcorner 3024657.6122834 cellsize  0.19970250725746 NODATA_value  -

Re: [R-sig-Geo] ESRI Ascii Grid

2009-01-14 Thread Dylan Beaudette
On Wed, Jan 14, 2009 at 1:14 AM, Roger Bivand wrote: > On Tue, 13 Jan 2009, Dylan Beaudette wrote: > >> On Tuesday 13 January 2009, Edzer Pebesma wrote: >>> >>> This sounds very familiar; I ran into this about 6 years ago or so. >> >> Could it be related to this ticket: >> >> http://trac.osgeo.org

[R-sig-Geo] autologistic model in R

2009-01-14 Thread Nicola Batchelor
Dear all, I'm currently using a logistic regression model for my dataset, which has a binary outcome of 0 or 1. I've looked at the residuals, which are spatially autocorrelated, so I want to do an autologistic regression model to remove any residual correlation. I've been looking online, a

[R-sig-Geo] Confused by overlay(x = "SpatialPixelsDataFrame", y = "SpatialPoints")

2009-01-14 Thread David Wahlund
Hi, trying to extract by mask using sp package. Was surprised that I couldn't find 'overlay(x = "SpatialPixelsDataFrame", y = "SpatialPolygon")' to extract pixels within a polygon. So instead I'm using ascPoints <- SpatialPoints(coordinates(asc)) ascPointsHR <- ascPoints[!is.na(overlay(ascPoints,hr

Re: [R-sig-Geo] ESRI Ascii Grid

2009-01-14 Thread Roger Bivand
On Tue, 13 Jan 2009, Dylan Beaudette wrote: On Tuesday 13 January 2009, Edzer Pebesma wrote: This sounds very familiar; I ran into this about 6 years ago or so. Could it be related to this ticket: http://trac.osgeo.org/gdal/ticket/2369 Yes, exactly! I have checked with readGDAL() with GDAL

Re: [R-sig-Geo] How to interpolate a raster-based point data?

2009-01-14 Thread Roger Bivand
On Wed, 14 Jan 2009, Yong Li wrote: Dear All, I have a points raster file (e.g. crop yield derived from RS) and I want to interpolate these discrete points in this 2D raster domain into a continuous crop yield surface for other further use. I knew I can do it in ILWIS and GRASS, but not sure