I want to plot spatial data, but don't know how to process the dataset.
For example, I have one shapefile, that can be opened with readOGR.
The other two datasets are about the attributes that I want to overlay the shapefile. Among them, one dataset (DF1) has precipitation for each grid cell, while the column name is the coordinate. The second dataset (DF2) has two rows, and many columns; the first row represent latitude and the second row represent longitude, and each column represent one grid cell corresponding to DF1. How to plot the precipitation data as a map, that has the shape as the shapefile? Thanks for your help.
DF1
lat1_lon1 lat1_lon2 lat1_lon3 ... lat2_lon1 lat2_lon2 ...
1.1 2.1 2,5 ... 2.7 1.8 ...
DF2
lat1 lat1 lat1 ... lat2 ...
lon1 lon2 lon3 ... lon1 ...
The above are examples of DF1 and DF2, note that DF1 has column names as the coordinates of each grid cell, while DF2 has no column names.