2

I am trying to plot a data with (Lat, Lon) and a value in each location. What I need to do is to plot the data over a shapefile, represent each value with a different color, and smooth the values, so no gaps occur in the map.

The data has the following structure: (Longitude, Latitude, Value), could you help me please.

I know how to plot the data over a shapefile with a different color, but the issue is in smoothing the values.

The data for the question is available in the following link:

https://drive.google.com/open?id=1bOpWjPoYc0Ix1cQqA73iFr-by0J1wU5l

where the:

1- (Lon, Lat, Value) data is in csv file "cluster__groups"

2- The shapefile files are in the folder "shapefile_question"

I ned to show them in regions. The output should be something similar to the following picture:

output_result

Thank you for your help. I tried to solve and search for a solution but could not find a solution, so pardon me if this is a discussed topic.

Best regards, Moe

Moe_D
  • 73
  • 6
  • You mention you want to plot the data over a "shapefile". A shapefile is a vector file... are you sure you didn't mean to plot the data on a *Raster* file, rather than a vector one like the shapefiles? Rasters with coordinates and values are commonly known as DEMs – DarkCygnus Nov 20 '17 at 17:14
  • no, I want to plot them over a shapefile. As in my question, I have the points (Lon, Lat, Value) and a shape file, and I want to plot the data to appear as a regions instead of points with gaps in locations with no information – Moe_D Nov 20 '17 at 17:32

1 Answers1

2

I will post a solution with some guidance, since there was no code posted. It seems that what you are after is how to perform spatial interpolation with R. You have your points divided into four categories and you want to create regions out of them. For this, there are a number of different approaches, and I will list three of them, easiest to hardest:

  1. Nearest neighbour;
  2. Inverse Distance Weighting (IDW);
  3. Kriging.

All of these techniques are available in R, and you can find a nice set of examples here. Keep in mind that these three techniques will give you slightly different regions, and sometimes they are combined in order to produce an "ensemble" of the most likely surfaces.

FaCoffee
  • 7,609
  • 28
  • 99
  • 174