Message-ID: <20110321102931.GA24192@greode>
Date: 2011-03-21T10:29:33Z
From: Georg Ruß
Subject: simple operation on data.frame or spatialPointsDataFrame
In-Reply-To: <AANLkTim1ioJepDif_R4BeP8VbqxtVY3WmsRijW=_yn9_@mail.gmail.com>
On 21/03/11 11:10:24, Eric Boeker wrote:
> Hi All,
>
>
> I'm fitting variograms in GSTAT with fit.variogram. The coordinates are in
> UTM (meters) and I got the Warning message: *singular model in variogram
> fit*.
>
> I found the reason from a previous archive mail of this warning message. (
> http://www.mail-archive.com/r-sig-geo at stat.math.ethz.ch/msg04054.html)
>
> Basically one possible solution is to divide the UTM coordinates (meters) by
> 1000 to convert them in km.
>
> [...]
> 1. Can this division take place directly on the SpatialPontsDataFrame or
> it should first be done on the dataframe?
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.
--
Research Assistant
Otto-von-Guericke-Universit?t Magdeburg
research at georgruss.de
http://research.georgruss.de