I have number of tables which contain temperature variable.
Moreover I have a table which contain coordinates.
I want to assign a specific row of the coordinate table to the temperature tables. In other words as a result a new column will be created in each temperature table which contains a row of the coordinate table. Moreover, based on id of the coordinate table corresponding values of the table should be added to the relevant temperature table with respect to the table name.
Table1:Tab2:Tab3: Tab4:
-0.52|-0.93|-0.23|-0.32
-0.56|-0.33|-0.13|-0.37
-0.54|-0.13|-0.33|-0.64
-0.5 |-0.93|-0.53|-0.63
-0.54|-0.83|-0.63|-0.43
-0.56|-0.53|-0.38|-0.34
-0.62|-0.03|-0.13|-0.33
Coordinate:
id E N
2 2579408.2431 1079721.1499
3 2579333.7158 1079729.1852
4 2579263.6502 1079770.1125
5 2579928.0358 1080028.4605
6 2579763.6471 1079868.9218
7 2579698.0756 1079767.9762
8 2579543.1019 1079640.6512
Results:
Table2:
Temperature coordinate
-0.52 2579408.2431 1079721.1499
-0.56 2579408.2431 1079721.1499
-0.54 2579408.2431 1079721.1499
-0.5 2579408.2431 1079721.1499
-0.54 2579408.2431 1079721.1499
-0.56 2579408.2431 1079721.1499
-0.62 2579408.2431 1079721.1499
First, let’s turn the column names into digits:
Then stack the data and change the names:
Finally, we merge the data: