Please consider using the R-sig-geo list for kriging questions.
In fact, using str() would show that your z is badly impacted by your misuse
of the c() function - this was almost certainly not what you wanted to do.
Constructing your coordinates by using seq() is always a bad idea, as you
need to be very careful in assigning position to data. Start by making sure
that your (long, lat) matrix of coordinates is correctly associated with the
data (you speak of a matrix with missing values - think of it as a vector,
or use an sp function to convert from "image" format to a
SpatialGridDataFrame, and coerce to a SpatialPixelsDataFrame). In fact, if
your data are on a grid, it is more than puzzling for what purpose you want
to use kriging interpolation, unless to hope to change resolution, or fill
in the missing values. You need to think much more carefully about your data
representations. Those used in the gstat package were chosen to avoid
slip-ups with input data (and output data), and use by default classes
defined in the sp package. Have you consulted the "Spatial" task view
on
CRAN?
Hope this helps,
Roger
karine heerah wrote:>
>
> Hi everybody,
>
>
>
> I have a longitude vector and a latitude one. Associated to these
> coordinates, i have a matrix with some data at some coordinates but not
> all.
>
>
>
> Lon <- seq(136.025,144.975,0.05)
> Lat <- rev(seq(-66.975,-65.525,0.05))
>
>
>
> dim(z) <- c(Lon,Lat)
>
>
>
> And i have tried to apply to these data a kriging function. But first i
> need to reshape these 3 variables to have a dataframe with these and with
> the corresponding z values with the good coordinates. Do you know how i
> can do that?
>
>
>
> And i will have the same problem with the object that return the krige
> function (gstat package). It gives me a dataframe, and i want a matrix for
> the prediction. How can i do that, in order to plot it with the image
> function after.
>
>
>
> Thanks a lot
>
> Karine HEERAH
>
> Master 2 , oc?anographie et environnements marins
> Universit? Pierre et Marie Curie (Paris 6)
> 42 rue Salvador Allende
> 92000 Nanterre
> 06.61.50.97.47
>
>
>
>
>
> _________________________________________________________________
> [[elided Hotmail spam]]
> tre t?l?phone!
>
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
-----
Roger Bivand
Economic Geography Section
Department of Economics
Norwegian School of Economics and Business Administration
Helleveien 30
N-5045 Bergen, Norway
--
View this message in context:
http://n4.nabble.com/kriging-problem-very-urgent-tp1754267p1773886.html
Sent from the R help mailing list archive at Nabble.com.