I am working on a small scale (a reservoir in Ohio, USA) and ultimately will be modelling with variograms and kriging.
When do I need to transform the coordinates from my base data and polygon into km, and when should I leave it just as coordinates? When I transform to km, do I then not need to ever assign a projection?
Right now I have in my base data: a column with fish density, a column with longitude, and a column with latitude. I have assigned each column as Z, X1, X2 in my db.data object. When I calculate the variograms I want to make sure that the x-axis is actually in km.
I am also having trouble with how to get my polygon to work in general. I want my polygon to be the extent of the reservoir. So, I have a shapefile that I can successfully read into R with readOGR command.
When I plot my base data fish density, and then overlay the shapefile on top, I only see a zoomed in portion of the reservoir outline. How do I expand the plot so that the entire shapefile is shown?
Then when I go to select only the samples that are included in my polygon I get an error:
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
This seems a crucial step so that I can set up my discretization grid for only the extent of the reservoir.
How do I get my shapefile as a polygon? And, once successful, how do I convert the polygon from coordinates to km?