[R-sig-Geo] Creating grid from xyz file

Paul Hiemstra p.hiemstra at geo.uu.nl
Thu Aug 27 09:30:53 CEST 2009


Mehdi Khan wrote:
> Sorry about that, this is what I did:
>
> wald<-read.table ("C:/Documents and Settings/MK/My Documents/USGS/R 
> Data/wald/california.xyz")
>
> names(wald)[1]<- "LON"
>
> names(wald)[2]<- "LAT"
>
> names(wald)[3]<- "vs30"
>
> coordinates(wald)<- c("LON", "LAT")
>
> gridded(wald)<- TRUE
>
> suggested tolerance minimum: 0.125000000000666
> Error in points2grid(points, tolerance, round, fuzz.tol) :
>   dimension 1 : coordinate intervals are not constant
Hi,

This error suggests that the data in california.xyz is actually not on a 
regularly spaced grid.

cheers,
Paul
>
> note: this is the same data frame I asked a question about last week.  
> There is also a grid file available but it seems extremely difficult 
> to get it to read in R.  ideas?
> On Wed, Aug 26, 2009 at 1:19 PM, Paul Hiemstra <p.hiemstra at geo.uu.nl 
> <mailto:p.hiemstra at geo.uu.nl>> wrote:
>
>     Mehdi Khan schreef:
>
>         Hello everyone,  I have a table with 2 columns containing
>         geographical
>         coordinates (lat, long) and one column containing attribute
>         data.  This is a
>         data frame object which I would like to convert into a grid
>         object.  It is
>         the 7.3 mb "california" file on this page:
>
>         http://earthquake.usgs.gov/research/hazmaps/interactive/vs30/predefined.php
>
>         I tried to use the "gridded" command, but it did not work for
>         my data. Is
>         there any other method?  Thank you!
>
>         Mehdi Khan
>
>                [[alternative HTML version deleted]]
>
>         _______________________________________________
>         R-sig-Geo mailing list
>         R-sig-Geo at stat.math.ethz.ch <mailto:R-sig-Geo at stat.math.ethz.ch>
>         https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>          
>
>     How exactly did you try the gridded command. Please be specific.
>
>     cheers,
>     Paul
>
>


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +3130 274 3113 Mon-Tue
Phone:  +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul



More information about the R-sig-Geo mailing list