[R-sig-Geo] Problem with Kriging with in strata

Zia Ahmed zua3 at cornell.edu
Wed Jan 26 18:07:41 CET 2011


  Hi,
I am trying to do kriging with in strata. I  use the example in book 
"Applied Spatial Data Analysis with R" page:217. It works fine with 
"meuse" data. But when I am  trying to use my data it shows some error 
massage.
Do I missing something here?
Thanks in advance
Zia

  Note: I am using following codes:


coordinates(tala) <- ~ x + y
gridded(tala.grid) = ~x+y
 > names(tala.grid)
[1] "lt.a"      "lt.b"      "elev"      "FDID"      "wfe_was"   
"was"       "was.lt"    "elev.sqrt"
# lt.a= flooding land type 1 and lt.b=flooding land type 2

tala$lt.a <- tala.grid$lt.a[overlay(tala.grid, tala)]
 > names(tala)

[1] "YID"  "FDID" "elev" "was"  "sas"  "lt.a" "lt.b"


x1 <- krige(sas ~ 1, tala[tala$lt.a == 0, ],tala.grid[tala.grid$lt.a == 
0, ], model = vgm(35,"Sph", 2000, 15), nmin = 8, nmax = 40, maxdist = 1000)

Error in tala[tala$lt.a == 0, ] : NAs not permitted in row index Error 
in krige(sas ~ 1, tala[tala$lt.a == 0, ], tala.grid[tala.grid$lt.a ==  :
   error in evaluating the argument 'locations' in selecting a method 
for function 'krige'

x2<- krige(sas~1, tala[tala$lt.a == 1, ],tala.grid[tala.grid$lt.a == 1, 
], model = vgm(30,"Sph", 2000), nmin = 8, nmax = 40, maxdist = 1000)

Error in tala[tala$lt.a == 1, ] : NAs not permitted in row index Error 
in krige(sas ~ 1, tala[tala$lt.a == 1, ], tala.grid[tala.grid$lt.a ==  :
   error in evaluating the argument 'locations' in selecting a method 
for function 'krige'


On 1/22/2011 4:51 PM, Edzer Pebesma wrote:
>
> On 01/22/2011 11:18 AM, Patrick Giraudoux wrote:
>> Hi,
>>
>> Does anybody knows if it is possible to fix user defined maximum and
>> minimum values in the key of a xyplot (or spplot) graphics ? I have a
>> set of seperate drawings and I would like to keep the same color scheme
>> between fixed values for all of them (which looks like being not
>> possible, autokey normally adapting the range of colors to the
>> particular range of values in each plot.
> If your object is of class SpatialPointsDataFrame, it may suffice to
> pass the argument "cuts" with the vector of cuts. If it is
> grid/polygons/lines, use the "at" component of the "colorkey" argument
> to specify breaks; see ?levelplot in package lattice.
>
>> Patrick
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110126/3420bfed/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zua3.vcf
Type: text/x-vcard
Size: 281 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110126/3420bfed/attachment.vcf>


More information about the R-sig-Geo mailing list