1

I am trying to map point density estimates of fish on a map of a lake, to then run geostatistical analyses on.

I have read in a shapefile of the outline of a lake by using readOGR function from rgdal, successfully. This object I named lake

My density estimates of fish, along with coordinates is in a db class object named db.data. I can plot my density estimates of fish with the line:

plot(db.data)

When I then overlay my lake on the plot of fish density estimates, with code plot(lake, add=T) the entire extent of the lake does not show up. Instead, it is cropped.

How do I get the entire outline of the lake shapefile to show up in this plot?

Leonardo
  • 2,439
  • 33
  • 17
  • 31
  • Could you post your code so far? It might be that the size of your plot isn't big enough. Try manually setting it. See https://stackoverflow.com/questions/2129952/creating-a-plot-window-of-a-particular-size – beth Jul 19 '17 at 14:40
  • Thanks, got it to work by manually setting it. Now I would like to set the extent of the shapefile in view on this plot to a polygon object. My next step is to select only the fish samples which are included in the polygon. My code so far is: fish <- read.csv("C/...") reservoir <- readOGR("C/...") db.data=db.create(fish) plot(db.data, ylim=c(), xlim=c()) plot(reservoir, add=T) db.data=db.polygon(db.data, reservoir) The input object is of type ' SpatialPolygonsDataFrame '. It should be of type ' polygon ' The function is interrupted Error: Invalid object type – Rebecca Dillon Jul 19 '17 at 19:53

0 Answers0