create.grid: Create a grid using latitude and longitude values.

Description Usage Arguments Details Author note Examples

Description

This function creates a SpatialPolygonsDataFrame grid using the boundaries and cell size selected by the user.

Usage

1
2
3
4
create.grid(Latitude = c(45, 52), Longitude = c(-70, -56),
  Grid.size = c(0.1, 0.1), Clip = FALSE, clip.shape, hexgrid = FALSE,
  hexproj = "+proj=lcc +lat_1=46 +lat_2=60 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0",
  projection = NULL)

Arguments

Latitude

A pair of coordinates that identifies the grid northern and southern limits.

Longitude

A pair of coordinates that identifies the grid eastern and western limits.

Grid.size

size of the grid cells in km.

Clip

Should the grid be clipped with a shapefile (TRUE) or not (FALSE).

clip.shape

Shapefile to use to clip the grid if Clip is set to TRUE

projection

coordinate reference system ID for the grid.

x

A data.frame containing observations.

Details

The projection used for the grid must match the projection used for the dataset if you want to use the grid for effort.grid and species.grid.

Author

Christian Roy

note

Large grid with small cell size can take a while to create. Be patient.

Examples

1
2
3
4
new.grid<-create.grid(Latitude=c(45, 54), Longitude=c(-70, -56), Grid.size=c(25000, 25000), Clip=FALSE, clip.shape=canshp, projection=NULL)
#plot the grid
plot(new.grid, axes=T)
#END

Vin985/ecapputils documentation built on May 9, 2019, 9:56 p.m.