Skip to content
Prev 11251 / 29559 Next

simple operation on data.frame or spatialPointsDataFrame

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.