Learn R Programming

SpatGRID (version 0.1.0)

SpatialGridR: Create a Spatial Grid from the list of longitude and latitude

Description

Create a Spatial Grid from the list of longitude and latitude

Usage

SpatialGridR(lon_list, lat_list, hemisphere, interval, outputShape)

Value

A spatial grid shapefile

Arguments

lon_list

A list of longitudes

lat_list

A list of latitudes

hemisphere

Either 'north' or 'south'

interval

Desired interval for the grid in meter

outputShape

Path to the output shapefile

References

1. Brus,D.J.(2022). Spatial Sampling with R (1st ed.).Chapman and Hall/CRC.<DOI:10.1201/9781003258940> 2. Hijmans, R. J. (2022). raster: Geographic Data Analysis and Modeling. R package version 3.5-13.

Examples

Run this code
if (FALSE) {
library(SpatGRID)
lon_list<-c(78,78,79,79,78)
lat_list<-c(20,21,21,20,20)
hemisphere <- 'north'
outputShape <- 'C:\\path\\to\\your\\data\\grid.shp'
interval <- 1000
Spatial_GRID <- SpatialGridR(lon_list, lat_list, hemisphere, interval, outputShape)
}

Run the code above in your browser using DataLab