Skip to content

simple operation on data.frame or spatialPointsDataFrame

3 messages · Eric Boeker, Georg Ruß, Edzer Pebesma

#
On 21/03/11 11:10:24, Eric Boeker wrote:
Hi Eric,

if you just want to change the UTM coordinates from meters to kilometer
(i.e. divide by 1000), that can be done on the spatialPointsDataFrame, in
the @coords part.

If sppdf is your spatial points data frame, then the following should do:

sppdfN <- sppdf
sppdfN at coords <- sppdf at coords/1000

sppdfN is then the new spatialPointsDataFrame with the coords in km.
Don't know if the result is what you intended.

Regards,
Georg.
2 days later
#
I find it hard to tell without being able to look over your shoulder.
Maybe you should try to pass a better initial model to fit.variogram;
have you tried to plot the initial model with the sample variogram?
On 03/21/2011 11:10 AM, Eric Boeker wrote: