roundLatLon: Round lon/lat coordinates at the same resolution as the...

View source: R/Round_Lat_Lon.R

roundLatLonR Documentation

Round lon/lat coordinates at the same resolution as the desired grid

Description

The roundLatLon function rounds lon/lat coordinates at the same resolution as the desired grid. It can be used to aggregate spatial point data

Usage

roundLatLon(
  x,
  origin = 0,
  cellsize = 1,
  where = c("bottom-Left", "middle", "top-right")
)

Arguments

x

Integer or numeric vector containing the lon/lat information.

origin

Integer or character vector containing target nodes IDs.

cellsize

A non-negative integer or numeric vector containing the edges weights.

where

Character indicating where the rounding has to occur with respect to the origin or grid cells (default 'Bottom-Left').

Examples

 lon = seq(1, 5, 0.01)
 lat = seq(1, 5, 0.01)
 roundLatLon(lon, origin = 0, cellsize = .123, where = "middle")
 roundLatLon(lat, origin = 0, cellsize = .123, where = "middle")


GranadoIgor/miscellaneousR documentation built on Sept. 20, 2023, 12:34 p.m.