lgndrzzz
lgndrzzz

Reputation: 108

Variogram for a "gridded" data

I have a gridded spatial 2d data,my coordinates data

if i try

vB=variogram(z~1, data=as.data.frame(data))

i get the error:

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘gridded’ for signature ‘"data.frame"’

Upvotes: 0

Views: 587

Answers (1)

Tung
Tung

Reputation: 28391

I suspect that you need a SpatialPointsDataFrame to use variogram function. So you have to convert your data frame first.

Assume your data frame has 3 columns x, y & z

data_sp <- data
coordinates(data_sp) = ~x + y
str(data_sp)

Upvotes: 1

Related Questions