Hello again,
Sorry to be dense about this but I'm still having
trouble working out how gstat operates within R in terms of data import (the
data import phase isn't in the examples in the demos).
I import my data fine - and have been trying it
with two approaches, one with the original ascii grid (dataA) and the
other with a csv list of x,y, and value (dataB).
> dataA <- read.table(file="testData.txt",
sep=" ", na.strings = "-9999", skip = 6)
> dataB <- read.table("testData2.csv",
sep=",", header=TRUE, row.names=1)
In attempting to plot a basic variogram, I do the
following and get the an error message I can't interpret (nor is there much help
on line with this error message):
> v <- variogram(log(A1)~1,loc= ~x+y,
dataB)
Error in vector("double", length) : negative length vectors are not allowed I'm also wondering how the variogram
function knows which column is x and which y (as is specified in the
command files), or is the x and y coded in?
With dataA (the asciigrid) I'm not even sure how to
create a variogram as it doesn't have a column header.
Please help.
Thanks in advance, and apologies for the simplistic
questions.
femke
|
- Re: creating a variogram with gstat in R femke
- Re: creating a variogram with gstat in R Edzer J. Pebesma