Message-ID: <CD5F7553.907F%fabian.ries@hydrology.uni-freiburg.de>
Date: 2013-03-08T10:00:35Z
From: Fabian Ries
Subject: assign coordinates(...) possible on rows?
Dear all,
I want to realize spatial analysis on rainfall data on a five minute time
step.
The data has the following format.
Station Stat_01 Stat_02 Stat_03 Stat_04
X 180000 195900 181950 192150
Y 157550 150950 154550 141650
30.04.11 00:05 0 0 0 0
30.04.11 00:10 0 0 0 0
30.04.11 00:15 0 0 0 0
30.04.11 00:20 0 0 0 0
30.04.11 00:25 0.2 0.4 1.2 0
30.04.11 00:30 0 0 0 0
30.04.11 00:35 0 0 0 0
30.04.11 00:40 0 0 0 0
30.04.11 00:45 0 0 0 0
30.04.11 00:50 0 0 0 0
When I convert the data now into SpatialPointsDataFrame I have to assign
coordinates(data) <? ~X+Y. All examples I saw until now are transposing
the data first so that the coordinates are changed to columns. If I follow
these examples and convert my data with t(data) I end up with a
SpatialPointsDataFrame with a huge amount of columns and have performance
problems to do some simple calculations through every object in the
dataframe.
I'm happy about any help
Cheers
Fabian